jandrews3 Posted July 2, 2008 Share Posted July 2, 2008 Can anyone tell me what is wrong with the following code: <? $last_log = date("d F, Y; G:i:s"); $query1 = "UPDATE ithf_members SET last_log = {$last_log} WHERE id = {$id}"; mysql_query($query1) or die("Could not perform update: ".mysql_error()); ?> I keep getting the following error: Could not perform update: 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 'July, 2008; 23:07:53 WHERE id = 1' at line 1 I tried it with each $last_log enclosed in single quotes, in brackets and without anything. The new mysql server I'm now using doesn't seem to like my older coding. Thanks! Link to comment https://forums.phpfreaks.com/topic/112877-update-problem/ Share on other sites More sharing options...
trq Posted July 2, 2008 Share Posted July 2, 2008 $query1 = "UPDATE ithf_members SET last_log = '{$last_log}' WHERE id = {$id}"; Link to comment https://forums.phpfreaks.com/topic/112877-update-problem/#findComment-579775 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.