title: How to insert things like "now() -interval '2 minutes'" into PHP PDO query?
body: <p>I have a query like this: (on Postgresql 8.4, PHP-fpm 5.3.10 (fpm-fcgi))</p>
  
  <pre><code>select * from users where now() - interval '2 minutes' &lt; seenlast ORDER BY seenlast;
  </code></pre>
  
  <p>I would like to use PHP/PDO query, so:</p>
  
  <pre><code>$mymin=5; //this is a variable can be changed by $_GET
  $query = $db_conn-&gt;prepare("select * from users where now() - interval ':myminute minutes' &lt; seenlast ORDER BY seenlast"); 
  $query-&gt;bindParm(":myminute",$mymin)
  $query-&gt;execute;
  </code></pre>
  
  <p>This does't work, I cant find a way to pass the minutes(<strong>$mymin</strong>) in a proper way. If I hardcode the timestuff everithing works, so the other part of the code must be correct.</p>
  
  <p>I also tried: </p>
  
  <pre><code>$temp=$mymin." minutes";
  $query = $db_conn-&gt;prepare("select * from users where now() - interval :myminute &lt; seenlast ORDER BY seenlast"); 
  $query-&gt;bindParm(":myminute",$temp)
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/10067782/php-pdo-insert-current-date-plus-one-month-into-mysql">I already saw this, didn't help</a></p>