Incidentally
SELECT MAX(id) AS last_id FROM table
may fetch you the maximum id value, but it may not necessarily be the last id (though it probably will be). The reason is that depending on the database engine and how the auto increment is configured, there may be a wraparound to unused ids from rows that were deleted.
That said, follow bradgrafelman's advice if what you really want to do is to use auto increment for a new row.