ZF-6900: mysqli binds to now() with qoutes


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 :-)


Nobody seems to reply on this... Too bad!

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.