My test code:
$connection = mysql_connect('localhost', 'root', '') or die(mysql_error());
mysql_select_db("chaoge", $connection);
mysql_query("SET NAMES UTF8", $connection);
$rs = mysql_query("SELECT * FROM babel_node WHERE nod_pid = 2101", $connection);
$nu = mysql_affected_rows();
echo $nu;
It says that mysql_affected_rows works with INSERT, UPDATE, REPLACE and DELETE。
Why I can also get the right result through mysql_affected_rows
?
Any help and suggestions will be highly appreciable。