ATM Posted December 21, 2006 Share Posted December 21, 2006 Hello,I know this is an easy question, but I'm not currently very good at SQL and would like to know how to update a TIMEDATE field.Currently I'm trying to use $current_timestamp=mysql_query("SELECT CURRENT_TIMESTAMP");$mysql_update_last_login=mysql_query("UPDATE account SET last_login='" . $current_timestamp . "' WHERE user_id='1'); Link to comment Share on other sites More sharing options...
Kristian_C Posted January 4, 2007 Share Posted January 4, 2007 Hello,I know this is an easy question, but I'm not currently very good at SQL and would like to know how to update a TIMEDATE field.Currently I'm trying to use$current_timestamp=mysql_query("SELECT CURRENT_TIMESTAMP");$mysql_update_last_login=mysql_query("UPDATE account SET last_login='" . $current_timestamp . "' WHERE user_id='1'); I dont know much about timestamp but i really think it is easyer to add it as DATETIME insted of timestamp if you just want to update the date when a user logs in.etc :$logintime = gmdate('Y-m-d h:i:s');mysql_query("UPDATE account SET last_login='$logintime' WHERE user_id='1'");->Kristian_C Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now