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.
NEED Advice. Site search with results by date
Re: NEED Advice. Site search with results by date
Here is what you do
In the "Additional Sql condition field add something like this
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.
In the "Additional Sql condition field add something like this
Code: Select all
record_id >= 0 ORDER BY some_date DESC
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
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
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
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.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
Or am I missing something?