PHP news board in order

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
TMLewiss
Forum Newbie
Posts: 3
Joined: Sun Jan 18, 2004 12:46 pm

PHP news board in order

Post by TMLewiss »

Ok i have a mySQL database and a php page that dispalys news from the SQL database. how do I order it by date.... Thanks in advance for the help
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

if the column in your database is called "date" the add to the mySQL statement "ORDER BY date ASC".
User avatar
vigge89
Forum Regular
Posts: 875
Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden

Post by vigge89 »

or else you could have a id-field, which auto increments on each insert, and then order the results by that

just a tip ;)
Post Reply