Maverickb7 Posted April 13, 2007 Share Posted April 13, 2007 Hello, I was wondering if someone could help me out. I've been using the below code. SELECT * FROM game_details WHERE gpub = \"$cid\" & gpid=\"9\" ORDER BY gname Basically I'm trying to specific to things after WHERE. It seemed to be working the way I thought it would until I tried using different numbers with gpid. If the value is set to 1 it will display all results with 1. But if I set it to 9 it does not display the results and is blank even though there are suppose to be results for 9. Anyone know what I'm doing wrong? Link to comment https://forums.phpfreaks.com/topic/46926-solved-using-where/ Share on other sites More sharing options...
PC Nerd Posted April 13, 2007 Share Posted April 13, 2007 ok, if the string uses double quotes, dont escape others in the string, use single insead of & use and see what happens..... also, check your using the right table, sounds stupic, but mak sure there isnt a spelling mistake or something..... gdlk Link to comment https://forums.phpfreaks.com/topic/46926-solved-using-where/#findComment-228838 Share on other sites More sharing options...
per1os Posted April 13, 2007 Share Posted April 13, 2007 $sql = "SELECT * FROM game_details WHERE gpub = '" . $cid . "' AND gpid = '9' ORDER BY gname"; That would be the proper SQL syntax. Link to comment https://forums.phpfreaks.com/topic/46926-solved-using-where/#findComment-228844 Share on other sites More sharing options...
Maverickb7 Posted April 13, 2007 Author Share Posted April 13, 2007 Thank you frost. I'll give that a try. =) Link to comment https://forums.phpfreaks.com/topic/46926-solved-using-where/#findComment-228845 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.