what is mysql_affected_rows and how to use it

mysql_affeted_rows()
this function returns the number of rows that are affected by the most current query for the present session.This function is valid for insret , update and delete statemetns.and if you want to sql statements implementation they do not affect them.
and if error comes they return -1;

here follows example:
mysql_query(mysql,INSERT INTO `wp_commentmeta`(`meta_id`, `comment_id`, `meta_key`, `meta_value`) VALUES ([value-1],[value-2],[value-3],[value-4])
mysql_query(mysql,”INSERT INTO TABLE’name’);
$show_rows=mysql_affected_rows(mysql) ;
print (“number of rows affected:%ul \n”,$show_rows);
in the above example , after insterting data in rows, we can find it where and how many rows are affected