History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-140
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Gavin
Reporter: Shaun Mitchell
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Zend_DB PDO insert

Created: 23/Jun/06 08:10 AM   Updated: 05/Jul/07 02:44 PM
Component/s: Zend_Db
Affects Version/s: 0.1.3
Fix Version/s: 0.1.4

Time Tracking:
Not Specified

Issue Links:
Duplicate
 


 Description  « Hide
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).



 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
jim kovalchuk - 23/Jun/06 01:03 PM
I'm pretty sure this is a dup and has been fixed.

Gavin - 28/Jun/06 07:25 PM
Yes, this should be fixed in the "developer" version.

Downloading the latest Developer/Subversion version of the ZF


Gavin - 28/Jun/06 07:32 PM
Fixed in Changeset 386.