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! } Quote 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']}'"); Quote 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']."'"); Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.