Hello I have this query :
$query="SELECT SP.ServicePic, D.Date, K.Keyword, C.Comment FROM Service_Pic SP, Position P, Date D, SPKeywords SPK, SPComments SPC, Keyword K, Comment C WHERE SP.Position_ID = P.Position_ID AND SP.Date_ID = D.Date_ID AND SP.ServicePic_ID = SPK.ServicePic_ID AND SPK.Keyword_ID = K.Keyword_ID AND SP.ServicePic_ID=SPC.ServicePic_ID AND SPC.Comment_ID = C.Comment_ID AND P.Position_ID = 1";
Which delivers me this results:
foto1 1935-01-05 são martinho This place changed so much! But still is one or pr...
foto1 1935-01-05 swimming pools This place changed so much! But still is one or pr...
foto1 1935-01-05 swim This place changed so much! But still is one or pr...
foto1 1935-01-05 south coast This place changed so much! But still is one or pr...
foto1 1935-01-05 costa sul This place changed so much! But still is one or pr...
foto1 1935-01-05 sea This place changed so much! But still is one or pr...
foto1 1935-01-05 mar This place changed so much! But still is one or pr...
foto1 1935-01-05 lido This place changed so much! But still is one or pr...
foto1 1935-01-05 gorgulho This place changed so much! But still is one or pr...
It's easy to retrieve the SP.ServicePic and D.Date fields, because they will always be unique.. the thing is.. Keywords and comments can be different and a lot..
I'm wondering how can I put all this values in an array, my final goal is to have an array with this format:
$whatever = array(pic=>$pic,date=>$date, keywords=>$keywords, comments=>$comments);
Where $keywords and $comments are also arrays of keywords and comments obviously... and ideally, the repeated keywords/comments would be filtered.. I read that can be done on mysql, though i'm not sure how.
Can someone help me with this please?