ZF-140: Zend_DB PDO insert


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


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

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

Downloading the latest Developer/Subversion version of the ZF

Fixed in Changeset 386.