PHP query, get rows from last 24 hours
<p>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 cannot get the time formatted correctly and -1 day.</p>

<pre><code>$yday  = mktime(0, 0, 0, date("m")  , date("d")-1, date("Y"));
$query = "SELECT * 
          FROM onloan
          WHERE (time &gt; $yday)";
</code></pre>

<p>Thanks in advance for any help!</p>
