ZF-140: Zend_DB PDO insert

Issue Type: Bug Created: 2006-06-23T08:10:27.000+0000 Last Updated: 2007-07-05T14:44:29.000+0000 Status: Closed Fix version(s): - 0.1.4 (29/Jun/06)

Reporter: Shaun Mitchell (shaun.mitchell) Assignee: Gavin (gavin) Tags: - Zend_Db

Related issues: - ZF-159



When using the PDO to perform an insert and the column name contains an underscore it can't find the binded paramater.

$db = Zend_Db::factory('pdoMssql', array(CONNECTION STUFF)); $db->insert('TABLENAME', array('column_name' => 1234));

Fails: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined

In the Zend/Db/Adapter/Pdo/Abstract.php insert method the binded value replaces _ to nothing but the binded keys are not also replaced so PDO can't find the match.

Using the above as an example the SQL looks like: INSERT INTO TABLENAME(column_name) VALUES(:columnname) but the $bind array still looks like ('column_name' => 1234).


Posted by jim kovalchuk (regulate) on 2006-06-23T13:03:18.000+0000

I'm pretty sure this is a dup and has been fixed.

Posted by Gavin (gavin) on 2006-06-28T19:25:58.000+0000

Yes, this should be fixed in the "developer" version.

Downloading the latest Developer/Subversion version of the ZF

Posted by Gavin (gavin) on 2006-06-28T19:32:23.000+0000

Fixed in Changeset 386.

Have you found an issue?

See the Overview section for more details.


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

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