We do not often need this but sometimes when we need to retrieve the next auto increment value of a table (without incrementing the auto increment value of course), this solution below will help.
Just replace “your_table_name_here” with your mySQL table name.
Furthermore, making it a PHP function would make the solution looks clean.
Hope this helps.
Thanks. it is very nice script