Jump to content


Photo

basic select statement working/not working


  • Please log in to reply
1 reply to this topic

#1 david*

david*
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 26 June 2003 - 10:24 AM

hello, first post here!

this is a basic select statment that works a million times over but seems not to work now. i wonder if anyone can see any problems with it?

$query = "SELECT link FROM `images` WHERE hotel= $hotel ";$result = @mysql_query($query);if(!$result){echo "not selcted";}else{echo "selcted";}

there is defo a column named \'link\' and column named \'hotel\' in a table named \'images\'.

i just put in the if statement for debugging at the mo...

if i cange $hotel to an actual name ie
hotel = \'my hotel\'
it works fine.

i have printed everything to the screen and the variable is defo being passed.

any ideas?

thanks in advance!

david* :D

#2 david*

david*
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 26 June 2003 - 02:24 PM

sorted it - silly me should have had
hotel=\'$hotel\'

david*




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users