SyntaxFix
Write A Post
Hire A Developer
Questions
Next to the information_schema suggestion, this:
SELECT id FROM table ORDER BY id DESC LIMIT 1
should also be very fast, provided there's an index on the id field (which I believe must be the case with auto_increment)