简体   繁体   中英

Zend Update query with IN using $db->quote()

Can any one tell where i am going wrong ?

$tmp = array();
    $tmp[] = 'account';
    //$tmp[] = 'tomwased';
    //  $tmp = 'eshantsahu,account';
        $qu = $this->_db->quote($tmp);
    //  print_r($qu);
        $this->_db->update('user',array('password' => 'dddd'),array("username IN ( ? )"=> $qu));

Try using next one

$updateData = array('username' => 'newvalue');

$whereConditions = array();
$whereConditions[] = $this->_db->quoteInto('param1 = ?', 'val1');
$whereConditions[] = $this->_db->quoteInto('param2 IN (?)', array('val2','val3');
$whereConditions = join(" AND ", $whereConditions);

$this->_db->update($updateData, $whereConditions);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM