How can I get the latest ID in a table?
SELECT id FROM table ORDER BY id DESC LIMIT 1 should work as well
SELECT id FROM table ORDER BY id DESC LIMIT 1