Jump to content

syntax error in query


jeff5656

Recommended Posts

This code worked until I added the variable "change".  Weird - is change a reserved word or something? 

$change = mysql_real_escape_string($_POST['change']);

--snip--

$query = "INSERT INTO hrct (hrct_id, pt_id, change, description, hrct_date)

VALUES('','$pt_id', '$change', '$description', '$hrct_date')";

mysql_query($query) or die(mysql_error());

 

The error is 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 'change, description, hrct_date) VALUES('','10', '', 'Description', '1969-12-' at line 1

 

Thank you

Link to comment
https://forums.phpfreaks.com/topic/189535-syntax-error-in-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.