klyxgaming Posted February 21, 2010 Share Posted February 21, 2010 sql v5 php v5 from searching I have seen many solutions that are CLOSE to what I am looking for however i am restricted in what i can do. SAMPLE DATA field: allgenreid data: 1,3,6,12 field: genreid data: 3 for example these games genres. the genre are games MAIN genre. the genreid is the same game with other genres it may have as well - example the main genre is 3 comedy. allgenreid will show other genres this movie has what I tried was sql ='SELECT * FROM game_data WHERE allgenreid LIKE %3%' so it will cycle through the whole data base using the allgenre to show any game with similar qualities. problem is that it doesn't work. if i do just: sql = 'SELECT * FROM game_data WHERE genreid=$gid' then it works but then the user misses out on seeing the others. I would like to be able to use the allgenreid instead of the genreid I tried REGEXP but that didn't seem to work, and LIKE did not produce the desired results, I can do this in a separate file, however i am checking first to see if there is a way to pull it with the SELECT command - if possible Link to comment https://forums.phpfreaks.com/topic/192771-imploded-array-in-mysql/ Share on other sites More sharing options...
Renegade85 Posted February 21, 2010 Share Posted February 21, 2010 Try this sql ="SELECT * FROM game_data WHERE allgenreid LIKE '%3%'" Link to comment https://forums.phpfreaks.com/topic/192771-imploded-array-in-mysql/#findComment-1015478 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.