How can the warning related to mysql_num_rows() be resolved in the PHP code?

The warning related to `mysql_num_rows()` can be resolved by using the `mysqli_num_rows()` function instead. This is because the `mysql_` functions are deprecated in PHP versions 5.5.0 and later, and have been removed in PHP 7.0.0. By switching to `mysqli_` functions, you can avoid the warning and ensure compatibility with newer PHP versions.

$result = mysqli_query($link, $query);
if($result){
    $row_count = mysqli_num_rows($result);
    echo "Number of rows: " . $row_count;
} else {
    echo "Query failed.";
}