What function should be used to check the number of rows returned by a MySQL query in PHP?

To check the number of rows returned by a MySQL query in PHP, you can use the `mysqli_num_rows()` function. This function returns the number of rows in a result set. You can use it to determine if any rows were returned by your query and take appropriate actions based on the result.

// Assuming $conn is your MySQL database connection and $query is your SQL query
$result = mysqli_query($conn, $query);

if(mysqli_num_rows($result) > 0) {
    // Rows were returned by the query
    echo "Number of rows returned: " . mysqli_num_rows($result);
} else {
    // No rows were returned
    echo "No rows returned";
}