From what I can see, when you write:
$sql="select * from Person where PersonID = $sql1" ;
...$sql1 is still the query you defined, so what you're really saying is this:
$sql="select * from Person where PersonID = select max(PersonID) from Person" ;
You would need to insert the value of $row["PersonID"] instead of $sql1 in $sql.
However, I think you could still fix this with one single query, if you went about it like this instead:
SELECT * FROM Person ORDER BY PersonID DESC LIMIT 1;