Need help with writing a query!!! |
[eluser]heylarson[/eluser]
Suppose I have a mysql table called 'events' that looks as such. Code: id start_date title The URL references the events by their event id as such, http://foo.com/event/2. I would like to put a prev and next event links, on the current event the user is looking at. Obviously, the prev/next event links would point to the nearest events based off their 'start_date' and referenced by their 'id'. For example, if you're looking at, http://foo.com/event/1, the prev link would be, http://foo.com/event/4, and the next link would be, http://foo.com/event/3. I have tried sorting the events by 'start_date' and return the results as an array, but I can't seem to get the surrounding event id's for the currently viewed event. Any help would be REALLY appreciated!! |
Messages In This Thread |
Need help with writing a query!!! - by El Forum - 08-24-2010, 01:02 PM
Need help with writing a query!!! - by El Forum - 08-24-2010, 01:42 PM
Need help with writing a query!!! - by El Forum - 08-24-2010, 02:09 PM
Need help with writing a query!!! - by El Forum - 08-24-2010, 02:40 PM
Need help with writing a query!!! - by El Forum - 08-24-2010, 03:40 PM
Need help with writing a query!!! - by El Forum - 08-24-2010, 06:22 PM
|