Issue

ZF2-420: In Update, only the last part of the where is used when an array provided

Issue Type: Bug Created: 2012-07-24T13:45:58.000+0000 Last Updated: 2012-07-27T14:59:31.000+0000 Status: Resolved Fix version(s): Reporter: Ithier de Lestrange (ithier) Assignee: John Kelly (postalservice14) Tags: - Zend\Db

Related issues: Attachments:

Description

When you do an update with the Zend\Db\Sql\Update class and you use the where function to give a clause, if you pass the clause as an array, only the last entry of the array is used.

Steps to repoduce the problem:

<pre class="highlight">
use Zend\Db\Sql\Update;
$update = new Update('table');
$update->set(array('fld1'=>'val1'));
$update->where(array('id1'=>'val1', 'id2'=>'val2'));
print ($update->getSqlString());

This code produce the following sql request:

<pre class="highlight">
UPDATE "table" SET "fld1" = 'val1' WHERE "id2" = 'val2'

instead of

<pre class="highlight">
UPDATE "table" SET "fld1" = 'val1' WHERE "id1" = 'val1' and "id2" = 'val2' 

Comments

Posted by John Kelly (postalservice14) on 2012-07-26T17:27:03.000+0000

Pull request sent: https://github.com/zendframework/zf2/pull/2001

Posted by John Kelly (postalservice14) on 2012-07-27T14:59:31.000+0000

Pull request merged to master

Have you found an issue?

See the Overview section for more details.

Copyright

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

Contacts