php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #7517 mysql_affected_rows doesn't work with mysql 3.23.25 with BDB table
Submitted: 2000-10-29 00:08 UTC Modified: 2001-01-22 21:09 UTC
From: jpoon88 at yahoo dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.0.2 OS: Red hat Linux 6.1
Private report: No CVE-ID: None
 [2000-10-29 00:08 UTC] jpoon88 at yahoo dot com
Hi,

We are developing a application using mySQL 3.23.25
beta version with php 4.02. If we created a mysql table for
type=BDB (mean transaction processing supports), The
transaction handling begin/commit/rollback method is
work perfect except mysql_affected_rows function
doesn't return anything (always 0). Did you have a
same problem under this situation. Thank you in
advance for your assistance.

James Poon

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-08 14:37 UTC] cynic@php.net
Could you please provide a short script reproducing the behavior?
 [2001-01-09 06:45 UTC] cynic@php.net
user feedback:
--------------
Regarding to case #7517, since we put the $conn->Affected_Rows() function after the commit statement, that why nothing return. If we put the Affected_rows() just after update/insert SQL Statement, it works. 
--------------

Manual is a bit ambiguous, as it says:

"Get number of affected rows in previous MySQL operation" - which would suggest affected rows of the _last_ operation will be returned, and "returns the number of rows affected by the last INSERT, UPDATE or DELETE query" - which would suggest it'll return affected rows of the last such query no matter what other types of queries follow it.

I've looked at the MySQL C API desc, and
http://www.mysql.com/documentation/mysql/commented/manual.php?section=node_431
says:
"May be called immediately after mysql_query() for UPDATE, DELETE, or INSERT statements."

So it should be probably emphasized in the manual.
 [2001-01-22 21:09 UTC] jimw@php.net
noted.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 10 05:01:31 2024 UTC