Sort results by date

mikeyd8
Posts: 7
Joined: 2012-08-22 23:24

Sort results by date

Post by mikeyd8 » 2012-12-20 23:41

Anyone have any idea how to have the results sort by date descending? I have a date field in the table being searched. I have applied the tips in this article http://www.interaktonline.info/article/ ... earch.html so that I have the date displayed in the page.

User avatar
Fred
Site Admin
Posts: 491
Joined: 2010-02-15 12:10
Location: Armagh, Northern Ireland
Contact:

Re: Sort results by date

Post by Fred » 2012-12-21 00:15

Just add the sort to the query.
Pretty sure it will work

Code: Select all

SELECT * FROM articles WHERE a_id = '$value' ORDER BY post_date DESC

User avatar
Fred
Site Admin
Posts: 491
Joined: 2010-02-15 12:10
Location: Armagh, Northern Ireland
Contact:

Re: Sort results by date

Post by Fred » 2012-12-31 12:31

Sorry Mikey I was talking a load of rubbish.

You can not sort the result as it is calculated based on the priority you set to the different tables and a load of other things as well.

Post Reply