Page 1 of 1
NEED Advice. Site search with results by date
Posted: 2013-08-08 20:34
by mikeyd8
I have a site, mysql 5, php 5. Data in tables with date fields. Here's the thing...
I need to site search but results must be in date descending order. I see lots of scripts around, but all seem to give results by relevance. I used phpdig with some success, but couldn't get results by date.
Used Interakt site search, and that was great, but again, couldn't get results by date.
Any ideas will be greatly appreciated.
Re: NEED Advice. Site search with results by date
Posted: 2013-08-11 09:26
by Fred
Here is what you do
In the "Additional Sql condition field add something like this
Code: Select all
record_id >= 0 ORDER BY some_date DESC
Note:
The additional condition is something following the "WHERE" part of the statement so you cant just add the "ORDER BY", you will get an error.
You need to satisfy the "WHERE" part of the statement first then you can add the usual stuff after that.
Re: NEED Advice. Site search with results by date
Posted: 2013-09-16 11:16
by bapa
Hi
I found that INTERAKT lists display date data in char order, so I created an extra field in my SQL in YYYYMMDD format - and display that in the list. That enables you sort and display the data correctly (but the filter is trickier).
B
Re: NEED Advice. Site search with results by date
Posted: 2013-09-19 19:48
by Fred
bapa wrote:Hi
I found that INTERAKT lists display date data in char order, so I created an extra field in my SQL in YYYYMMDD format - and display that in the list. That enables you sort and display the data correctly (but the filter is trickier).
B
So how is this going to help you sort the results in this instance? You will still need to add the "additional sql" for the "site search" SB like I suggested in my last response.
Or am I missing something?