What is the correct function to use to count the number of rows returned by a MySQL query in PHP?
To count the number of rows returned by a MySQL query in PHP, you can use the `mysqli_num_rows()` function. This function takes the result set returned by a query as a parameter and returns the number of rows in that result set. You can use this function to easily determine the number of rows returned by a query and perform any necessary actions based on that count.
// Assuming $conn is your MySQL database connection and $query is your SQL query
$result = mysqli_query($conn, $query);
$row_count = mysqli_num_rows($result);
echo "Number of rows returned: " . $row_count;