ZF-6900: mysqli binds to now() with qoutes
Description
When using prepared statements I bind dates into the query.
for example:
$query = $this->db->query("select * from table where DATE( ? ) between from and to", array($date));
if $date is "2009-06-04" it works fine: DATE( "2009-06-04" )
But when $date contains "now()" the quotes should be left out: DATE( now() ).
It's not a big deal. But it makes my life a bit easier :-)
Comments
Posted by Christoph Kempen (webpatser) on 2009-07-10T01:54:07.000+0000
Nobody seems to reply on this... Too bad!
Posted by Josh Butts (jimbojsb) on 2009-08-17T19:31:19.000+0000
In the context of a prepared statement, parameter placeholders (?) may only be data values. The MySQL API does not permit you to bind NOW() as a parameter.
Reference: http://dev.mysql.com/doc/refman/…