php – 在symfony中使用propel的WHERE IN子句
作者:互联网
如何使用propel创建以下查询?
UPDATE tablename SET status = 1 WHERE id IN (1,2,3,4)
解决方法:
$con = Propel::getConnection();
$selectCriteria = new Criteria();
$selectCriteria->add(TablenamePeer::ID, array(1,2,3,4), Criteria::IN);
$updateCriteria = new Criteria();
$updateCriteria->add(TablenamePeer::STATUS, 1);
BasePeer::doUpdate($selectCriteria, $updateCriteria, $con);
标签:propel,php,mysql,symfony1 来源: https://codeday.me/bug/20190726/1545811.html