First, avoid using mysql this extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used. Now back to your question, you are printing out the wrong value, your query using mysqli should look like this
$res = "SELECT max(person_id) FROM Persons;";
$person = mysqli_query($conn, $res);
echo $person;
this will return nothing because the result is an array(mysqli object) it cannot be converted to string just like that but, using print_r we can print out the value of person as follows
print_r($persons);
you should get something like this
mysqli_result Object ( [current_field] => 0 [field_count] => count [lengths] => [num_rows] => rows [type] => 0 )
the count and rows represents, depending on the results the number of fields and rows used in the query.
To print out the $person variable correctly, as in your query above it should be
$res = "SELECT max(person_id) FROM Persons;";
$result = mysqli_query($conn, $res);
//fetch the database values as an asscoiative array
while($row = mysqli_fetch_assoc($result))
{
$person_id = $row['person_id'];
}
echo $person_id;
this should print the value you wanted