我在CakePHP的應用程序,它運行通過的方法在模型中,像這樣一個簡單的更新語句的動作:CakePHP中獲得的原始SQL語句的影響行
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);
}
查詢運行良好,但我怎麼弄受影響的行數?所有返回的都是一個空數組。
(請務必提供有問題你正在使用的框架版本) – Dave