Im trying to build a ‘last user login’ script but im not sure how to go about it.
Im my database i have a column ‘last login’ which is in the format 2011-04-01 15:30:52 for each user, and users that havent logged in yet are 0000-00-00 00:00:00
Could someone help me to get the details of the last user that logged in and disregard the users with 0000-00-00 00:00:00
Cheers,
Assuming MySQL,
select * from users order by last_login desc limit 1;