Home > Database > Mysql Tutorial > mysql 解决row_count()用mysql_affected_rows()获取后值为-1的方

mysql 解决row_count()用mysql_affected_rows()获取后值为-1的方

WBOY
Release: 2016-06-01 09:56:57
Original
2076 people have browsed it

row_count()用mysql_affected_rows()获取后值一直为-1
怎么解决row_count()的senssion问题,实现读取在mysql的insert和update的变化!

------解决方案--------------------
跨SESSION无法直接通过row_count()得到其它用户更新了更新了多少记录。

row_count()必须立即在UPDATE语句执行后使用,才能得到刚执行的语句影响了多少记录。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template