如何在具有Zend_Db和QuoteInto的更新语句中使用多个条件

|| 使用Zend Framework,有没有一种方法可以使用quoteInto方法将多个条件传递给更新语句?我已经找到了对此问题的一些参考,但是我正在寻找一种受支持的方法,而不必扩展Zend_Db或不进行串联。
$db = $this->getAdapter();
$data = array(\'profile_value\' => $form[\'profile_value\']);
$where = $db->quoteInto(\'user_id = ?\', $form[\'id\'])
       . $db->quoteInto(\' AND profile_key = ?\', $key);         
$this->update($data, $where);
参考文献 http://blog.motane.lu/2009/05/21/zend_db-quoteinto-with-multiple-arguments/ http://codeaid.net/php/multiple-parameters-in-zend_db::quoteinto%28%29     
已邀请:
        您可以为
$where
参数使用
array
类型。元素将与
AND
运算符组合:
$where = array();
$where[] = $this->getAdapter()->quoteInto(\'user_id = ?\', $form[\'id\']);
$where[] = $this->getAdapter()->quoteInto(\'key = ?\', $key);
$this->update(array(\'value\' => $form[\'value\']), $where);
    
        从1.8开始,您可以使用:
$where = array(
    \'name = ?\' => $name,
    \'surname = ?\' => $surname
);
$db->update($data, $where);
    
        只是刷新上面的答案
$data = array(\'value\' => $form[\'value\']);
$where = array();
$where[] = $this->getAdapter()->quoteInto(\'user_id = ?\', $form[\'id\']);   
$where[] = $this->getAdapter()->quoteInto(\'key = ?\', $key);
$this->update($data, $where);
    

要回复问题请先登录注册