david* Posted June 26, 2003 Share Posted June 26, 2003 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* Link to comment https://forums.phpfreaks.com/topic/638-basic-select-statement-workingnot-working/ Share on other sites More sharing options...
david* Posted June 26, 2003 Author Share Posted June 26, 2003 sorted it - silly me should have had hotel=\'$hotel\' david* Link to comment https://forums.phpfreaks.com/topic/638-basic-select-statement-workingnot-working/#findComment-2133 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.