MYSQL time and date troubles -


i running query show upcoming events , selecting events closest current date , sorting on basis of timing.

so suppose today's date 18th july 2013, pulling out top 3 events closest july 18th .

so if event on 22nd july 2013, select 3 events , because of , in query checking timing of event .

now if current time 23:00 , time of event 19:00 event on 22nd july wont show event because according query should greater curtime ..

so how should solve problem.. in advance

$sql="select * events d_o_e>=curdate() , t_o_e>=curtime() order d_o_e asc,t_o_e asc limit 3;"; 

 $sql="select * events d_o_e>=curdate() or  ( d_o_e=curdate() ,  t_o_e>=curtime() ) order d_o_e asc,t_o_e asc                    limit 3;"; 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -