I need to get the next id from the table (auto_increment).
I could just use SELECT * from table ORDER BY id DESC LIMIT 1;
For example, I get 50. But if we remove from two elements of the table, I get 48, but fix one
will be 51. How to get the correct value, even we will delete something from the table?
source share