To absolutely reliably find the last record, you need to keep track of when a record is inserted. Then, you order by the insertion date/time in reverse, and select the first row.
Of course, you can still do this ORDER BY ... LIMIT without recording the insertion date/time and just relying on an auto incremented id, but then you have to check your DBMS documentation to ensure that deleted ids will never be reused.