我在我的CakePHP应用程序中有一个动作,通过模型中的一个方法运行简单的update语句,例如:
public function remove_nasties(){
$query = 'UPDATE holdings
SET holdings.account_id = CONCAT(account_id, "n")
WHERE holdings.nasty = 1 AND Right(holdings.account_id,1) != "n";';
return $this->query($query);
}
查询运行正常,但我该如何获取受影响的行数?返回的仅是一个空数组。