| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [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>";
			EXIT;
			}
		}
	
	PRINT "<CENTER><H3>Insert was successful!</CENTER></H3>";
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 12:00:01 2025 UTC | 
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