It should be exactly the same as Oracle:
mysql_connect("localhost");
mysql_select_db("my_database");
$query = "select * from table1 where id =
(select max(id) from table2)";
$result=mysql_query($query);
You'll need to feed the result set to one of the mysql fetch functions to get the individual fields. I have assumed that both tables are in the same database.
Good luck!