Issues

ZF-3437: misleading exception message for zend db statement parameters

Issue Type: Improvement Created: 2008-06-11T08:21:22.000+0000 Last Updated: 2012-03-21T11:06:07.000+0000 Status: Resolved Fix version(s): - 1.6.2 (13/Oct/08)

Reporter: Karol Grecki (antych) Assignee: Satoru Yoshida (satoruyoshida) Tags: - Zend_Db

Related issues: Attachments:

Description

I switched an adapter from pdo to mysqli and this triggered an exception: Zend_Db_Statement_Exception' with message 'Invalid bind-variable position ':status'

I looked at the source of Zend_Db_Statement and discovered that Mysqli just doesn't support named parameters. Could the message be changed so it's clear what the problem is?

<pre class="highlight">
if ($this->_adapter->supportsParameters('positional') === false) {
...
   throw new Zend_Db_Statement_Exception("Invalid bind-variable position '$val'");
...
if ($this->_adapter->supportsParameters('named') === false) {
...
   throw new Zend_Db_Statement_Exception("Invalid bind-variable position '$val'");

The same exception is also thrown in situation where quotes are not stripped properly, @see ZF-3025, which makes it even more confusing.

Cheers

Comments

Posted by old of Satoru Yoshida (yoshida@zend.co.jp) on 2008-08-29T01:11:09.000+0000

Solved in rSVN11116

Have you found an issue?

See the Overview section for more details.

Copyright

© 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.

Contacts