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 '', 0,' at line 2
the mysql server version that I am using is:4.1.18
How can I prevent this error from occurring?
Code: Select all
<?php
$DRCVD = $_POST['DRCVD'];
$OCONT = $_POST['OCONT'];
$CONTENTS = $_POST['CONTENTS'];
$DEADLINE = $_POST['DEADLINE'];
$GIVENTO = $_POST['GIVENTO'];
$STATUS = $_POST['STATUS'];
$COMPLETED = $_POST['COMPLETED'];
$OUTCOME = $_POST['OUTCOME'];
$NOTES = $_POST['NOTES'];
$con = mysql_connect("ahahhh", "hghsfh", "agag");
mysql_select_db("ahahhfr", $con);
$query = "INSERT INTO cases (DRCVD, OCONT, CONTENTS, DEADLINE, GIVENTO, STATUS, COMPLETED, OUTCOME, NOTES)
VALUES ( 'DRCVD', 'OCONT', 'CONTENTS', 'DEADLINE', 'GIVENTO', 'STATUS', 'COMPLETED', 'OUTCOME', NOTES', ";
if (isset($COMPLETED))
$query = $query . "1, ";
else
$query = $query . "0, ";
$result = mysql_query($query);
mysql_query($query) or die ('origdepart query'.mysql_error());
?>