I have a query like this: (on Postgresql 8.4, PHP-fpm 5.3.10 (fpm-fcgi))
select * from users where now() - interval \'2 minutes\' < seenlast ORDER BY seen
... - INTERVAL :myminute MINUTES ...
without the quotes is the proper method. If it helps, think of the placeholders as the equivalent of use old-school variable-based query building methods
... - INTERVAL $myminute MINUTES
except the placeholders take care of the injection vulnerabilities that the variables don't. Just because you're using placeholders doesn't mean you can change SQL syntax, so
... - INTERVAL '2 minutes'
... - INTERVAL ':myminute minute'
are not valid SQL.
followup for mu:
mysql> select now() + interval '2 minute';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
mysql> select now() + interval 2 minute;
+---------------------------+
| now() + interval 2 minute |
+---------------------------+
| 2013-01-22 13:38:24 |
+---------------------------+
1 row in set (0.02 sec)