I have to find the next available id (if there are 5 data in database, I have to get the next available insert place which is 6) in a MySQL database. How can I do that? I h
It's too late to answer this question now, but hope this helps someone.
@Eimantas has already given the best answer but the solution won't work if you have two or more tables by the same name under the same server.
I have slightly modified @Eimantas's answer to tackle the above problem.
select Auto_increment as id from information_schema.tables where table_name = 'table_name' and table_schema = 'database_name'