通常,这对我有用:
$db = Zend_Db_Table::getDefaultAdapter();
$where = $db->quoteInto('id = ?', $id);
$db->delete('tablename', $where);
但我必须匹配两个 id。所以我真的不知道如何构建它。
WHERE first_id = 'id1' AND second_id = 'id2'
那么我该如何使用 Zend Framework 来做到这一点呢?
最佳答案
扩展 Jason W 的回答:
Not exactly sure what the 3rd section is saying
这意味着你可以这样做:
$db->delete('tablename', array(
'first_id = ?' => $first_id,
'second_id = ?' => $second_id
));
适配器将为您引用所有内容。
不过我觉得文档不是很清楚。
关于zend-framework - Zend 框架 : How to delete a table row where multiple things are true?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51826153/