Get next autoinc value in Before Trigger

from the Artful MySQL Tips List


In the Trigger ...
  set @nextauto = (select auto_increment 
                   from information_schema.tables 
                   where table_schema=Database() and table_name='your table name'
                  );

Last updated 9 Mar 2016


Return to the Artful MySQL Tips page