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!
Revisions
There are no revisions for this post.
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.