Prepare statement - limit results by timestamp
<p>I want to limit the SQL results to older than 1 week.</p>

<p>Here's how it looks in an usual SQL-query which is not prepared: </p>

<pre><code> SELECT * 
   FROM `table_name` 
  WHERE timestamp &lt; DATE_SUB(NOW(), INTERVAL 7 DAY) 
  ORDER BY `timestamp` DESC"
</code></pre>

<p>But as I am using PDO and I prepare all the queries, I tried to do this:</p>

<pre><code>    $query = $db-&gt;query('SELECT * FROM `database` WHERE timestamp &lt; DATE_SUB(NOW(), INTERVAL :time DAY) ORDER BY `timestamp` DESC');
    $query-&gt;bindValue(':time', 7, PDO::PARAM_INT);
    $query-&gt;execute();
</code></pre>

<p>But nothing happened.
I usually manage to get everything right, but this one was a little tricky. I hope you can help me.</p>
