Jump to content

Recommended Posts

So I have around 8 columns that have tags for categories. Is there a way I could merge all of these into one column, then just parse by commas though php? Heres what I have now.

 

$query  = "SELECT COUNT(ratings.id) as rates,ratings.rating_id,games.gameid as gameid,gametitle as gametitle,gameimage as gameimage,gametitle as gametitle,ROUND(AVG(ratings.rating_num),2) as rating FROM ratings,games WHERE games.gameid = ratings.rating_id AND caturl='$location' OR games.gameid = ratings.rating_id AND tags1='$location' OR games.gameid = ratings.rating_id AND tags2='$location' OR games.gameid = ratings.rating_id AND tags3='$location' OR games.gameid = ratings.rating_id AND tags4='$location' OR games.gameid = ratings.rating_id AND tags5='$location' OR games.gameid = ratings.rating_id AND tags6='$location' OR games.gameid = ratings.rating_id AND tags7='$location' OR games.gameid = ratings.rating_id AND tags8='$location' OR games.gameid = ratings.rating_id AND tags9='$location' GROUP BY rating_id ORDER BY rating DESC LIMIT $offset, $rowsPerPage";
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.