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

Issue Type: Bug Created: 2009-06-04T02:23:25.000+0000 Last Updated: 2009-08-17T19:31:20.000+0000 Status: Resolved Fix version(s): Reporter: Christoph Kempen (webpatser) Assignee: Ralph Schindler (ralph) Tags: - Zend_Db_Adapter_Mysqli

Related issues: Attachments:


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


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.


Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.