cliftonbazaar Posted June 2, 2009 Share Posted June 2, 2009 $check_adventures = mysql_query("SELECT * FROM adventures WHERE image='{$_GET["adventure"]}'"); will not work I have put 'echo $_GET["adventure"]' and it gives me "james_adventure" and I have double checked the database and the 'image' is "james_adventure" as well, yet the statement will not return the record. Note that the code below works fine. $check_adventures = mysql_query("SELECT * FROM adventures"); WHILE($adventure = mysql_fetch_array($check_adventures)) { //Lets loop through all the records IF ($_GET["adventure"]==$adventure['image']) break; //We have a winner! } Link to comment https://forums.phpfreaks.com/topic/160571-solved-where-on-my-statement-is-not-working/ Share on other sites More sharing options...
Alex Posted June 2, 2009 Share Posted June 2, 2009 $check_adventures = mysql_query("SELECT * FROM adventures WHERE image='{$_GET['adventure']}'"); Link to comment https://forums.phpfreaks.com/topic/160571-solved-where-on-my-statement-is-not-working/#findComment-847429 Share on other sites More sharing options...
Alt_F4 Posted June 2, 2009 Share Posted June 2, 2009 $check_adventures = mysql_query("SELECT * FROM adventures WHERE image='".$_GET['adventure']."'"); Link to comment https://forums.phpfreaks.com/topic/160571-solved-where-on-my-statement-is-not-working/#findComment-847434 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.