是否可以在不进行黑客攻击的情况下生成该SQL?
DELETE FROM product WHERE (type=1 AND deleted=1) OR (type=2 AND category=10);
答案 0 :(得分:1)
使用此示例:
$db->delete(array('(type=1 AND deleted=1) OR (type=2 AND category=10)'));
或者如果每个表都有一个模型类,那么:
$model = new Product();
$model->delete(array('(type=1 AND deleted=1) OR (type=2 AND category=10)'));