Could you guys please tell me how to show all online people on the top and all offline after, both lists in ascending order of the username just like Skype does.
My MySQL table is Users, and the columns are as follow:
ID
Username
Last_logged_in - is with unix_timestamp();
the code I am using to show online people is as follow:
select * from users where Last_logged_in >= UNIX_TIMESTAMP() - 60;
and the code I tried was like so:
select id, username, last_logged_in from users where last_logged_in >= UNIX_TIMESTAMP() - 60 UNION select id, username, last_logged_in from users where last_logged_in <= UNIX_TIMESTAMP() - 60 LIMIT 10;
some helps will be really appreciated.