Jump to content

basic select statement working/not working


david*

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.