Displaying last login time in php
php
Solution
you can also use `now()` in the query if you not using `$currentDate` any where in the code
mysql_query('UPDATE `users` SET `last_sctivity` = now()');
also make sure the column `last_sctivity` is `timestamp` and not `date`
Problem
I am beginner in Php. I have made a login and register system which works perfectly but I wish to display the last login time when the user logs in. I have a table(TIMESTAMP) which stores the data as 2013-03-08 00:00:00 . It displays the date but not the time. I also want to display these results when the user logs in. I am using the below code when the data validation is successful and the user session variable is set. ``` $currentDate = date('Y-m-d g:i:s'); mysql_query('UPDATE `users` SET `last_sctivity` = "' . $currentDate . '"'); ```