Day -1 question

Hi

I am trying to make a report that shows all the loans made in the last day. The time is saved as a time stamp in the database onloan and is saved in the format yyyy-mm-dd 00:00:00. The code I have so far is shown below but i caanot get the time formatted correctly and -1 day.

[php]

$yday = mktime(0, 0, 0, date(“m”) , date(“d”)-1, date(“Y”));

$query = “SELECT *
FROM onloan
WHERE (time > $yday)”;

[/php]

Thank you and any help is greatly appreciated.

either use php datetime functions strtftime/strtotime or mysql datetime functions

Sponsor our Newsletter | Privacy Policy | Terms of Service