This topic is locked

Syntax Issue

4/1/2012 11:14:38 AM
PHPRunner General questions
T
Tempus_Erus author

Hi,
Can anyone help with the below?
I get the following error..........
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 '2012 where sysID = '1'' at line 1
Basically I am checking a date in a table against a another value and updating the record accordingly.
I have the following code in befiore record added.....
global $conn;

$strUpdate = "update system_date set check_date=".$values['newdate']." where sysID = '1'";

db_exec($strUpdate,$conn);
Appreciate any help or advice...........

C
cgphp 4/1/2012

Try this version:

global $conn;

$strUpdate = "update system_date set check_date='".$values['newdate']."' where sysID = 1";

db_exec($strUpdate,$conn);
T
Tempus_Erus author 4/1/2012



Try this version:

global $conn;

$strUpdate = "update system_date set check_date='".$values['newdate']."' where sysID = 1";

db_exec($strUpdate,$conn);



brilliant, thanks Cristian works perfectly.
Thanks you for the incredible speed of reply!