Re: Two troublesome fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux