I have searched for many days on google on this. And I have learned quite a bit. I'm stuck on one part of my code I cannot get to work.
i have a field called `allgenreid` which list all the game genres by numerical id (eg. 1,2,3,4,5 ... 200)
I used to use the following
however this returns many undesirable results. If i am looking for gamegenre #5, it would return 5,15,25,35...15 5 etc.. NOT what I want
Later I learned of a sql command: FIND_IN_SET(). That is perfect. Once problem I realized was that the following does not work
I didnt realize it, until i debugged that is was comparing $id to the string "allgereid" and not `allgenreid` 's contents
How do I go about getting an exact search? There seem o be millions of results on Google (spent a week looking) and most of the answers I tried, do not work.
I think I have searched so long that now I'm missing the obvious LOL
i have a field called `allgenreid` which list all the game genres by numerical id (eg. 1,2,3,4,5 ... 200)
I used to use the following
Code:
SELECT * FROM table_name WHERE `allgenreid` LIKE '%$id%'
Later I learned of a sql command: FIND_IN_SET(). That is perfect. Once problem I realized was that the following does not work
Code:
SELECT * FROM table_name WHERE FIND_IN_SET('$id',`allgenreid`)
How do I go about getting an exact search? There seem o be millions of results on Google (spent a week looking) and most of the answers I tried, do not work.
I think I have searched so long that now I'm missing the obvious LOL
Comment