Boxerman Posted July 31, 2008 Share Posted July 31, 2008 Hi guys, i installed a script working nicely, i went to edit something and got this error "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' where ad_id=''' at line 1" here is line 1: $tablae = mysql_query("SELECT * FROM ads where ad_id='$id'"); // selecciono todos los registros de la tabla usuarios, ordenado por nombre ive seen the where ad_id= all over the place yet this one is causing a problem? Link to comment https://forums.phpfreaks.com/topic/117501-doing-my-thing/ Share on other sites More sharing options...
ronnie88 Posted July 31, 2008 Share Posted July 31, 2008 what is the variable input for $id? should say something like $id= something sounds like $id isn't working since its outputting blank make sure you set your session Link to comment https://forums.phpfreaks.com/topic/117501-doing-my-thing/#findComment-604381 Share on other sites More sharing options...
paul2463 Posted July 31, 2008 Share Posted July 31, 2008 it is telling you that $id does not exist Link to comment https://forums.phpfreaks.com/topic/117501-doing-my-thing/#findComment-604382 Share on other sites More sharing options...
MasterACE14 Posted July 31, 2008 Share Posted July 31, 2008 before: $tablae = mysql_query("SELECT * FROM ads where ad_id='$id'"); add this: if(!isset($id)) || empty($id)) { die("ID is not set!!"); } see if if that is returned. Link to comment https://forums.phpfreaks.com/topic/117501-doing-my-thing/#findComment-604384 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.