Hey everyone
I've just designed the 'inbox' for my online users to carry out peer to peer messaging through my website and all is working OK, displaying results in a table of the message date, message sender and message subject but typically the newest message is displayed on the bottom row, how can I change this so the more recent messages are at the top?
Reversing Displayed results from a table
Moderator: General Moderators
- vargadanis
- Forum Contributor
- Posts: 158
- Joined: Sun Jun 01, 2008 3:48 am
- Contact:
Re: Reversing Displayed results from a table
Hi,
you need to order the mysql results. I suppose you have something like ID or sent date stored in the table. Try something like:
This will put the newest on top.
Regards!
you need to order the mysql results. I suppose you have something like ID or sent date stored in the table. Try something like:
Code: Select all
$rec = mysql_query("SELECT * FROM `table` ORDER BY `sentData` DESC");Regards!
Re: Reversing Displayed results from a table
Excellent thankyou!