Day -1 qurstion

Hey i have a problem trying to make a query to show any new fields added in the last 24 hours. The date and time is held in the database as a time stamp in the format yyyy-mm-dd 00:00:00.

I currently have this but it is not working properly

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

echo $yday;

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

I have tried changing the format of this date but cannot get it to work.

Any help would be greatly appreciated.

hello worthy ,

i think you have to define date and time in the database as an integer field instead of timestamp and than execute your query.

~~SR~~
Sponsor our Newsletter | Privacy Policy | Terms of Service