The given PHP example helps you to get the number of affected rows by the last INSERT, UPDATE, REPLACE or DELETE query associated with link_identifier. Code Example:
<?php $server = "localhost"; $username = "root"; $password = ""; $database = ""; $conn = mysql_connect($server, $username, $password) or die("Couldn't connect to MySQL" . mysql_error()); mysql_select_db($database); $query = "UPDATE mytable SET title = 'test' WHERE status = 'Y'"; $result = mysql_query($query); print "Total row updated: ".mysql_affected_rows(); // return -1 if last query is failed. mysql_close($conn); ?>