I have a second part of a form, where the details for the first part are already in the database, and now I need to add the managers comments.
So can you use a WHERE clause when using INSERT as below:
$sql = mysql_query("INSERT INTO hazzard (Name, Employerofperson, Contactphone, Location, DateOccured, ProductionZone, NearMissDetails, Anyimmediateactions) WHERE UniqueIdentifier=".$report_ID." VALUES ('".mysql_real_escape_string($_SESSION['name_A'])."','".mysql_real_escape_string($_SESSION['companies_A'])."','".mysql_real_escape_string($_SESSION['numbers_A'])."','".mysql_real_escape_string($location)."','$current_time','$ProductionZone','".mysql_real_escape_string($detail)."','".mysql_real_escape_string($feedback)."')") or die (mysql_error());
Im getting ther error below, and cant see any problem, my syntax seems correct
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 ‘with electricity, Rottcause=Defective materials or equipment, Behaviours=Deliber’ at line 1