list output from recent to previous?

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
melchor_06
Forum Newbie
Posts: 13
Joined: Wed Feb 11, 2009 3:58 am

list output from recent to previous?

Post by melchor_06 »

i need to know how can i list the ouputs from my database
which the recent input will on top and the previous will on the bottom.

my code is this:

Code: Select all

 
<?php echo date("mdY",$value['date']); ?>
 
which outputs data from previous on top and the recent will be on the bottom.

thanks guys...
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: list output from recent to previous?

Post by susrisha »

in your mysql query give it order by date DESC

eg:
$query = "SELECT * FROM table ORDER BY datevariable DESC";
Post Reply