I need to write/read the date and time from the DB table. When I log in to my page, I wnat to read the saved date and time and when I logout I want to write to the DB the curent date and time, so When I login next time, to read the last login date and time. I stored a date format like this in the DB table "2014-09-12 14:48:30" but my code is not even read from it..
$login_event = mysql_query("SELECT DATE_FORMAT(events, '%M %D, %Y') AS mydate FROM login_events WHERE name = $login_name");
echo $login_name;
Please if someone can help me out on this I will be very grateful!