php, mysql, listing the oldest news 1st n latest at the bottom of page?

Question by red poppy: php, mysql, listing the oldest news 1st n latest at the bottom of page?
i made the news module, placed it, it works only problem is tht it shows oldest news at top n latest at the bottom of the page. wht i made wrong? n how im suposed to fix this?

Best answer:

Answer by Yanni Depp
Use the ORDER BY clause like this:

SELECT * FROM news ORDER BY datePosted DESC;

What do you think? Answer below!

No related content found.

Revisions

There are no revisions for this post.

Tags: , , , , , ,

One Response to “php, mysql, listing the oldest news 1st n latest at the bottom of page?”

  1. Colinc August 31, 2011 at 6:41 AM #

    You need to set order by item_date desc, or item_date asc, to set descending or ascending date order to the end of your select query. Descending in your case. And ensure you are storing the date in a date related data type or date sorts turn into string sorts with unpredictable results.

Leave a Reply