Codeigniter db->update() VS MySQL native UPDATE Affected rows: 0

扶醉桌前 提交于 2019-12-01 20:46:37

Try getting the query that CodeIgniter is running using the following code:

$this->db->last_query();

Also post the query you are using to interact with MySQL, just to confirm that the exact same query is being run.

CodeIgniter does have a hack for MySQL that adjusts the reporting of affected rows, however I was under the impression it was only for DELETE queries. If you look at system/database/drivers/mysql/mysql_driver.php or system/database/drivers/mysqli/mysqli_driver.php (whichever driver you are using and look at the variable var $delete_hack = TRUE;. Adjusting that might impact your result, could be worth a try?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!