Issues

ZF2-551: Db\Sql\Insert: use of __set add a new column as if already exists

Issue Type: Bug Created: 2012-09-13T11:44:26.000+0000 Last Updated: 2012-10-08T20:14:33.000+0000 Status: Closed Fix version(s): Reporter: Mélous Stéphanie (stefy31) Assignee: Ralph Schindler (ralph) Tags: - Zend\Db

  • Insert
  • Zend_Db
  • __set

Related issues: Attachments:

Description

(sorry for my english :) )

For example, I have the Insert object as follows : [columns:protected] => Array ( [0] => Email [1] => Password [2] => Name [3] => FirstName ) [values:protected] => Array ( [0] => myaddress@gmail.com [1] => monmotdepasse [2] => Name [3] => My first Name )

Then I apply : $insert->Password = "mynewpassword",

So I have :

[columns:protected] => Array ( [0] => Email [1] => Password [2] => Name [3] => FirstName [4] => Password )

[values:protected] => Array
    (
        [0] => smelous@gmail.com
        [1] => monmotdepasse
        [2] => Mélous
        [3] => Stéphanie
        [4] => mynewpassword
    )

So I have now 2 columns "Password" and if I try to apply this query, I have this error message :

File:

/library/Zend/Db/Adapter/Driver/Pdo/Statement.php:216

Message:

SQLSTATE[42000]: Syntax error or access violation: 1110 Column 'Password' specified twice

Thank you very much :)

Comments

Posted by Ralph Schindler (ralph) on 2012-10-08T20:14:33.000+0000

This issue has been closed on Jira and moved to GitHub for issue tracking. To continue following the resolution of this issues, please visit: https://github.com/zendframework/zf2/issues/2579

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