Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why doesn't this script work??? 1

Status
Not open for further replies.

sd0t1

IS-IT--Management
Mar 14, 2007
131
US
I use this way to insert data all the time, now all of a sudden only on this script do I get this error.
<--here is the 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 'desc), VALUES ('sdothard', 'Smoking is healthy', '2008/21/05', '5:00', 'Teach yo' at line 1

<---this is the code-->

if (isset($_POST['MM_insert']) && $_POST['MM_insert'] == "form1")
{
$insertSQL = "INSERT INTO training (name, class, date, time, desc) VALUES ('$name', '$class', '$nd', '$time', '$desc')";
$insert = mysql_query($insertSQL, $user_login) or die(mysql_error());
}

Any thoughts on why this won't work?
 
desc" is a keyword. Change it or encapsulate it in backticks.
 
Awesome, thanks Lgarner.

That's exactly what it was.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top