MySql error
Posted: Wed Aug 26, 2009 8:37 pm
i get 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 id=' at line 1
this is my code:
mysql_query("SELECT id,message FROM $subject WHERE id=$id") or die ('Error: '.mysql_error ());
im confused because i (think) that the problem is with the $subject because when i replace it it works (more or less) and i use it (with the $subject) in another script which works. i assign the $subject earlier in the script so what the ....
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 id=' at line 1
this is my code:
mysql_query("SELECT id,message FROM $subject WHERE id=$id") or die ('Error: '.mysql_error ());
im confused because i (think) that the problem is with the $subject because when i replace it it works (more or less) and i use it (with the $subject) in another script which works. i assign the $subject earlier in the script so what the ....