gsquare567 Posted April 29, 2007 Share Posted April 29, 2007 mysql_query("UPDATE AuthDB SET 'Last Login' = '$find_time' WHERE Username = '$find_user'"); doesnt work =S the variable echoed Sunday, April 29th, 2007 at 8:28:13 AM (sweet formatting, eh?) Link to comment https://forums.phpfreaks.com/topic/49155-double-worded-column-name-problem/ Share on other sites More sharing options...
toplay Posted April 29, 2007 Share Posted April 29, 2007 Can't have a space in a column name...change it to an underscore instead. Can't use single quotes around column names...can use backtick marks. Examples: $sql = "UPDATE AuthDB SET `Last_Login` = '$find_time' WHERE `Username` = '$find_user'"; mysql_query($sql); or mysql_query("UPDATE AuthDB SET `Last_Login` = '" . $find_time . "' WHERE `Username` = '" . $find_user . "'"); It's best if last_login column is a datetime type and hence not have this formatting: Sunday, April 29th, 2007 at 8:28:13 AM but rather: 2007-04-29 08:28:13 With the column being a datetime type, you can then choose to display it any way you want using the DATE_FORMAT() function. It shouldn't be saved in the format you show in case you wish to do date calculations using many of the build in date/time functions in MySQL. hth Link to comment https://forums.phpfreaks.com/topic/49155-double-worded-column-name-problem/#findComment-240885 Share on other sites More sharing options...
gsquare567 Posted May 1, 2007 Author Share Posted May 1, 2007 thank you so much for the nice reply. tons of info too. ur a great teacher ^^ Link to comment https://forums.phpfreaks.com/topic/49155-double-worded-column-name-problem/#findComment-242004 Share on other sites More sharing options...
gsquare567 Posted May 1, 2007 Author Share Posted May 1, 2007 actually, on this topic, how do i set the timezone to eastern time? Link to comment https://forums.phpfreaks.com/topic/49155-double-worded-column-name-problem/#findComment-242015 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.