mysqli_affected_rows() returns -1 but query works

僤鯓⒐⒋嵵緔 提交于 2019-12-03 22:45:48

I had exactly the same problem. I've investigated the issue with Netbeans and Xdebug and it seems this is a bug in the MySQLi extension itself. An according bug report has been made. In the meantime you can instead use a more forgiving Expression, e.g.

if (mysqli_sqlstate($dbc) == 00000) {
//your code
}

to continue debugging your remaining code.

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