The mysqli_num_rows() function returns the number of rows in a result set. This function only works
with queries that return a data set, such as SELECT.
Practical use: It is very useful when you want to check if a query found any records before trying to output them. If the function returns 0, you know that the table is empty or that no records match your criteria.
mysqli_affected_rows().