在
MySQL文档中,有一条关于在事务提交后使用MysqL_affected_rows的注释:
http://php.net/manual/en/function.mysql-affected-rows.php
http://php.net/manual/en/function.mysql-affected-rows.php
Note: Transactions
If you are using transactions,you need to call MysqL_affected_rows() after your INSERT,UPDATE,or DELETE query,not after the COMMIT.
但是,PDOStatement :: rowCount doc上没有这样的说明:
http://www.php.net/manual/en/pdostatement.rowcount.php
这是否意味着在使用PDO对象时,INSERT,UPDATE或DELETE查询后提交不会影响受影响的行数?