Is there any reason for mysqli_affected_rows
takes $link
as first parameter instead of query?
example usage for mysqli_num_rows
$con = mysqli_connect(..);
$query = mysqli_query($con, "SELECT * FROM table WHERE id='5'");
echo mysqli_num_rows($query);
//output: 1
example usage for mysqli_affected_rows
$con = mysqli_connect(..);
mysqli_query($con, "UPDATE table SET column='value' WHERE id='5'");
echo mysqli_affected_rows($con);
//output: 1
Shouldn't it be better that mysqli_affected_rows
takes $query instead?