jamesxg1 Posted October 21, 2009 Share Posted October 21, 2009 Hiya peeps, I have a table with a row consisted of times EG. 9:20, 9:30 so on and so on. How do i echo the five times closest to the current time ?. Thanks, James. Quote Link to comment https://forums.phpfreaks.com/topic/178503-how-do-i-do-this/ Share on other sites More sharing options...
jamesxg1 Posted October 21, 2009 Author Share Posted October 21, 2009 Anyone ? Quote Link to comment https://forums.phpfreaks.com/topic/178503-how-do-i-do-this/#findComment-941334 Share on other sites More sharing options...
cags Posted October 21, 2009 Share Posted October 21, 2009 Your bumping a post 4 minutes after posting it? Ever heard of patience? When you say closest to, are we talking either side of before or after? If before or after you can probably use a method similar to WHERE time > $now ORDER BY time LIMIT 5 if you wish times either side it will probably be abit more complicated Quote Link to comment https://forums.phpfreaks.com/topic/178503-how-do-i-do-this/#findComment-941341 Share on other sites More sharing options...
Maq Posted October 21, 2009 Share Posted October 21, 2009 Your bumping a post 4 minutes after posting it? Ever heard of patience? He tends to do that a lot. I gave up and decided to take the path of least resistance. Quote Link to comment https://forums.phpfreaks.com/topic/178503-how-do-i-do-this/#findComment-941361 Share on other sites More sharing options...
salathe Posted October 21, 2009 Share Posted October 21, 2009 Do you have one row with many times, or many rows with one time in each? What is the column type being used (TIME, DATETIME...)? Quote Link to comment https://forums.phpfreaks.com/topic/178503-how-do-i-do-this/#findComment-941363 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.