Jump to content

[SOLVED] Invalid query. error in SQL syntax


jeff5656

Recommended Posts

I get this error:

Invalid query: 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 '], mrn = '0',your_name = 'Michael Mendez', dx = 'PNA w/ background Asbestos Expo' at line 1

 

with this:

 

<?php
session_start();

if($_SESSION['xray']!='y'){
$_SESSION['loc']='../xray/displayactive.php';	
header("location:../telephone/main_login.php");
}

include "connectdb.php";
$mrn_pre = $_POST['mrn'];
$mrn = ereg_replace("[^A-Za-z0-9]", "", $mrn_pre);

$subm = $_POST['subm'];
$patient = mysql_real_escape_string($_POST['patient']);
$mrn = mysql_real_escape_string($_POST['mrn']);
$your_name = mysql_real_escape_string($_POST['your_name']);
$dx = mysql_real_escape_string($_POST['dx']);
$hx = mysql_real_escape_string($_POST['hx']);
$show_xr = mysql_real_escape_string($_POST['show_xr']);
$show_ct = mysql_real_escape_string($_POST['show_ct']);
$path = mysql_real_escape_string($_POST['path']);
$show_path = mysql_real_escape_string($_POST['show_path']);
$rcf_date = mysql_real_escape_string($_POST['rcf_date']);
$conf_date = mysql_real_escape_string($_POST['conf_date']);
$teach = mysql_real_escape_string($_POST['teach']);
$comments = mysql_real_escape_string($_POST['comments']);
$fellow = mysql_real_escape_string($_POST['fellow']);
$signoff_status = mysql_real_escape_string($_POST['signoff_status']);




$sql = "UPDATE xrayconf SET	patient_name = '$patient_name'], mrn = '$mrn',your_name = '$your_name',	dx = '$dx',
hx = '$hx',	show_xr = '$show_xr',  	show_ct = '$show_ct',path = '$path',show_path = '$show_path',rcf_date = '$rcf_date',
   	conf_date = '$conf_date' teach = '$teach', 	comments = '$comments', fellow = '$fellow',	signoff_status = '$signoff_status'

WHERE id_incr = ".$_POST['id_incr']."";
if (isset($sql) && !empty($sql)) {
$result = mysql_query($sql) or die ("Invalid query: " . mysql_error());


}
if ($subm == 'y') {
header("Location: displaypotential.php");
}
elseif ($subm == 'old') {
header("Location: displayold.php");
}

else  {
header("Location: displayactive.php");
}

?>

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.