Hello, I have table with articles that has the fields (id, title, text, image, date, time). The date field is a date field and the time field is a time field. But i want to filter on my site that it must only show articles that be not later than the current time. So if i have added an article to show today but on a later hour than the current one it must not be visible. I'm stuck with this i know how to filter on the current date. I'm doing it this way date <= '".date ("Y-m-d")."'. But can some helps me how i can filter on date and time ? Cheers, Kris
select title, text, image from articles where date<=curdate() and time<=curtime(); That should do the trick assuming you are using Mysql. I suspect that the <=". date(Y-m-d")."'. is an PHP thingy to get the currect date for this to work perfectly the www and DB server clocks should be running roughly the same date and time.