ZF-140: Zend_DB PDO insert
Description
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).
Comments
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.