Associate
- Joined
- 25 Aug 2004
- Posts
- 163
- Location
- Reading
I have a php date variable (either as it is or as a timestamp) and I want to get the closest matching value to that date from the MySQL database, which there may be more than one of. Is there anyway of doing that in a query or do I have to pull everything in a 'select *' query and sort through the array and use my value as a pointer and select the above or below value? And I need to just select one date (or the set at that date rather) if there is the same distance between the date below and above the current date. It's bugging me now!
Cheers,
Gareth
Cheers,
Gareth