gpt4 book ai didi

zend-framework - Zend 框架 : How to delete a table row where multiple things are true?

转载 作者:行者123 更新时间:2023-11-29 17:12:10 24 4
gpt4 key购买 nike

通常,这对我有用:

$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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com