This is a method of mysqli by which we can get the number of affected rows in the previous MySQL operation.
There are two formats are available for this of the method is as follows:
Object Oriented Style (property):
mysqli, int $affected_rows.
int mysqli_affected_rows(mysqli $link)
printf("Connect failed:%s \n",mysqli_connect_error()); exit();
$result=$db->query("select name from student");
printf("Affected rows:%d \n",$db->affected_rows);
Recommend the tutorial