I am trying to make a report that shows all the loans made on the last day. The time is saved as a timestamp in the onloan database and saved in the format yyyy-mm-dd 00:00:00. The code that I have so far shown below, but I can not format the time and -1 day correctly.
$yday = mktime(0, 0, 0, date("m") , date("d")-1, date("Y"));
$query = "SELECT *
FROM onloan
WHERE (time > $yday)";
Thanks in advance for your help!
source
share