From: Terion Miller <webdev.terion@xxxxxxxxx>
Date: February 19, 2009 5:34:50 PM EST
To: Bastien Koert <phpster@xxxxxxxxx>
Cc: PHP General <php-general@xxxxxxxxxxxxx>
Subject: Re: Two troublesome fields
I just tried this and now it's not inserting at all where before
everything
EXCEPT two fields go in...
$sql = "INSERT INTO workorders ( CreatedDate, Location, WorkOrderName,
AdminID, FormName, Status, Notes) VALUES (";
$sql .= "Now(), ";
$sql .= "'". mysql_real_escape_string($Location) ."', ";
$sql .= "'". mysql_real_escape_string($WorkOrderName) ."', ";
$sql .= "'". mysql_real_escape_string($AdminID) ."', ";
$sql .= "'". mysql_real_escape_string("WorkOrder") ."', ";
$sql .= "'". mysql_real_escape_string("New Order") ."', ";
$sql .= "'". mysql_real_escape_string($Notes) ."', ";
$WorkOrderID = mysql_insert_id();
mysql_query($sql);
There's no closing parethesis to VALUES, try...
$sql .= "'". mysql_real_escape_string($Notes) ."')";
Sean DeNigris
sean@xxxxxxxxxxxxxxxx