mysql syntax error... I don't understand
Posted: Tue Apr 26, 2011 3:05 am
I can't see any error in this script and it's driving me insane. Would someone please (I'm begging) please take a look and see where the error is. It makes no sense to me and I'm too bald already to keep pulling my hair out with this error. Thank you in advance...
The above script ouputs the following error...
Code: Select all
$sql = mysql_query("INSERT INTO courses (location, course, instructor, blurb, description) VALUES ('$location', '$class', '$teacher', '$blurb', '$description'");
if(!$sql) {
echo "Sorry there was a problem adding that class due to the following error:";
echo "<br />- " .mysql_error();
echo "<br />" .$teacher;
echo "<br />" .$class;
echo "<br />" .$location;
echo "<br />" .$blurb;
echo "<br />" .$description;
exit();
}
please please please help me on this one, I am losing my mind as I can't see the error and the mysql_error() isn't helpfull at all. Thank you again,Sorry there was a problem adding that class due to the following 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 '' at line 1
Mary Mezinis
Amazing English
classroom
this is just a test course to see if the add script is working.
Please do not try to sign up for this class, it is just a test to see if the add script is working properly.