Jump to content

[SOLVED] WHERE on my statement is not working


cliftonbazaar

Recommended Posts

$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!
  }

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.