Display users from Newest to Oldest

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Ruthless.
Forum Newbie
Posts: 1
Joined: Thu Feb 23, 2012 3:37 pm

Display users from Newest to Oldest

Post by Ruthless. »

Hey,

I am designing a website. I was wondering in the admin panel how would I display users from newest to oldest.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Display users from Newest to Oldest

Post by Celauran »

Assuming you store registration date in the database, something like this should suffice:

Code: Select all

SELECT username FROM tablename ORDER BY join_date DESC
litebearer
Forum Contributor
Posts: 194
Joined: Sat Mar 27, 2004 5:54 am

Re: Display users from Newest to Oldest

Post by litebearer »

in the event of no join date, AND presuming you have an auto increment id field, ordering by id desc will also work
Post Reply