Have you tried:
$query = "SELECT *
FROM table_name
ORDER BY auto_increment_field ASC";
$result = msyql_query($query);
$rows = mysql_num_rows($result);
$query2 = "SELECT *
FROM table_name
WHERE id = '$rows'";
It's a work-around, but I'm pretty sure it works, unless you break your auto-increment.
You could also just query for the ID, then order it DESC, and limit it to 1 record (pulling the last record), and manipulate from there:
$lastrow = mysql_query("SELECT auto_increment_field FROM table_name ORDER BY auto_increment_field DESC LIMIT 1");
// $lastrow will now be the highest ID number in the database
Hope that helps.
~Brett