You can use the method mysql_affected_rows():
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db('mydb');
mysql_query('insert into mytest values ('103');');
printf("Records inserted: %d\n", mysql_affected_rows());
mysql_query('update mytest set id = 12 where id = 10;');
printf("Records updated: %d\n", mysql_affected_rows());
source
share