Jump to content

syntax error


jeff5656

Recommended Posts

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 'leave) VALUES('','', '', '', '','2010-02-11', 'Resolution of indication','y',' at line 1

 

for this code.  Any ideas?  I don't see where the syntx error is.

 

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

$rm_loc_pre = $_POST['rm_loc'];
$rm_loc = ereg_replace("[^A-Za-z0-9]", "", $rm_loc_pre);
$patient = mysql_real_escape_string($_POST['patient']);
$mrn_pre = $_POST['mrn'];
$mrn = ereg_replace("[^A-Za-z0-9]", "", $mrn_pre);

$remove_date = date("Y-m-d", strtotime($_POST['remove_date']));
$remove_reason = mysql_real_escape_string($_POST['remove_reason']);
$suture = mysql_real_escape_string($_POST['suture']);

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


$query = "INSERT INTO clines (id, pt_id, patient, rm_loc, mrn, remove_date, remove_reason, suture, leave)  

VALUES('','$pt_id', '$patient', '$rm_loc', '$mrn','$remove_date', '$remove_reason','$suture', '$leave')";

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

Link to comment
https://forums.phpfreaks.com/topic/191824-syntax-error/
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.