Jump to content

Invalid query


jeff5656

Recommended Posts

I get "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 '= '111', = 'fdsaf', = 'kjhk', = 'kj', = '', = 'm', = 'iyh', ' at line 2"

 

for this code:

 

<?php
require('secure.php'); 

include "dateheader.php"; 
include "connectdb.php";


$newdate = date("Y-m-d", strtotime($_POST['rcf_date']));

$sql = "UPDATE icu SET
$rm_loc = '" . $_POST['rm_loc'] . "',
$patient = '" . $_POST['patient'] . "',
$mrn = '" . $_POST['mrn'] . "',
$age = '" . $_POST['age'] . "',
$race = '" . $_POST['race'] . "',
$gender = '" . $_POST['gender'] . "',
$attg = '" . $_POST['attg'] . "',
$rcf_date = '" . $_POST['rcf_date'] . "',
$dx = '" . $_POST['dx'] . "',
$pmhx = '" . $_POST['pmhx'] . "',
$diet = '" . $_POST['diet'] . "',
$meds = '" . $_POST['meds'] . "',
$sed = '" . $_POST['sed'] . "',
$ivf = '" . $_POST['ivf'] . "',
$abx = '" . $_POST['abx'] . "',
$cx = '" . $_POST['cx'] . "',
$prophylaxis = '" . $_POST['prophylaxis'] . "',
$vent = '" . $_POST['vent'] . "',
$lin = '" . $_POST['lin'] . "',
$code = '" . $_POST['code'] . "',
$allergy = '" . $_POST['allergy'] . "',
$todo = '" . $_POST['todo'] . "',
signoff_status = '" . $_POST['signoff_status'] . "',
rcf_date2 = '$newdate'


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


?>
<p>
Done
<?php
}
header("Location: displayactive.php");

?>

Link to comment
https://forums.phpfreaks.com/topic/126925-invalid-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.