...

View Full Version : Sorting data recieved from a databse



ItsMe
03-02-2007, 06:52 PM
Hi

I have several records in a database that hold information about events. Each of these has a date field.

What i want to do is be able to sort the data by the date field when i retrieve it from the database, so i can display it in order on my page ie. most recent at the top.

I have the data being retrieved from the database successfully, and just being displaying in no order, but i dont know how to sort the data.

Any suggestions?

Many Thanks.

Inigoesdr
03-02-2007, 07:00 PM
SELECT * FROM `table` WHERE 1 ORDER BY `datefield` DESC

ItsMe
03-02-2007, 07:14 PM
I thouht it'd be something like that.

Many thanks for your reply. :thumbsup:

Inigoesdr
03-02-2007, 07:22 PM
You're very welcome. =D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum