使用$ db-> quote()使用IN进行Zend Update查询

时间:2013-10-25 06:54:11

标签: php sql zend-framework

任何人都可以告诉我哪里出错吗?

$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));

1 个答案:

答案 0 :(得分:0)

尝试使用下一个

$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);