php - How to select a record with upcoming date and time? -


i have table called events. table contains event_date , event_time in separate columns. i'm working on page show upcoming events. how query records events table date , time still upcoming? mean, how calculate or write query, where clause, using mysql? i'm using php , codeigniter.

thanks answer.

edit: used gordon linoff's suggestion:

where event_date >= now() or       (event_date = date(now()) , event_time > time(now())) 

but modified to

where event_date>date(now()) or       (event_date=date(now()) , event_time>time(now())) 

because gordon's didn't quite return result expecting (events dated on current day time has not yet come not appearing upcoming events). anyway, gordon , other people answered. not yet expert in mysql date queries, guys did me huge favor.

you use:

where event_date >= now() or       (event_date = date(now()) , event_time > time(now())) 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -