note 12402 deleted from function.mysql-affected-rows by betz

From: Date: Wed, 21 Apr 2004 10:18:32 +0000
Subject: note 12402 deleted from function.mysql-affected-rows by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-68427@lists.php.net to get a copy of this message
Note Submitter: stephen@opido.com ---- [Editor's Note: Review the above documentation carefully! mysql_affected_rows() works with connection handles returned by mysql_connect() or mysql_pconnect(), not with result handles returned by mysql_query() or mysql_db_query() --zak@php.net] Just a quick note, if you try to run this against a stored result that failed it will spit an error message as well: // If the query failed, this will give an extra error plus "failure" $rSQL = mysql_query($sSQL) echo (mysql_affected_rows($rSQL)?"success":"failure"); to fix this, just leave out the link_identifier, it will pick it up from the last query executed: // If the query failed, this will just show "failure" $rSQL = mysql_query($sSQL) echo (mysql_affected_rows()?"success":"failure"); hope that helps anyone who might have been scratching their heads on that :)

« previous php.notes (#68427) next »