|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6483 mysql_affected_rows not functioning
Submitted: 2000-09-01 11:40 UTC Modified: 2000-09-01 12:16 UTC
From: tsmith at qsigroup dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0.1pl2 OS: osx server
Private report: No CVE-ID: None
 [2000-09-01 11:40 UTC] tsmith at qsigroup dot com
I upgraded to PHP Version 4.0.1pl2 and mysql_affected_rows no longer works.  mysql_num_rows works, but all my pages that query the DB using a DELETE, UPDATE, and INSERT and checking with mysql_affected_rows returns nothing.  It worked when I had PHP3.  Did the format change???

$queryB = "INSERT INTO $userstable (l_name, f_name, title, business, address, city, state, zipcode, bus_tel, bus_fax, email) VALUES ('$l_name','$f_name','$title','$business','$address','$city','$state','$zipcode','$bus_tel','$bus_fax','$email')";
		$resultB = MYSQL_QUERY($queryB);
		@$numberB = MYSQL_AFFECTED_ROWS($resultB);
		PRINT "This is numberB: ".$numberB."<BR>";

		if ($numberB != "1")
			PRINT "<CENTER><H3>Insert into PRSA was unsuccessful.</CENTER></H3>";
	PRINT "<CENTER><H3>Insert was successful!</CENTER></H3>";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-01 11:59 UTC] tsmith at qsigroup dot com
This is the error I receive for this line of code.
Line of code:
     $numberB = MYSQL_AFFECTED_ROWS($resultB); 
Error message:
   Warning: Supplied argument is not a valid MySQL-Link resource in
/Local/Library/WebServer/WebSites/PRSA/prsaInput.php on line 68

 [2000-09-01 12:16 UTC]

int mysql_affected_rows ([int link_identifier])

Leave that $resultB out. Then it works.

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Jun 01 09:01:28 2020 UTC