php - get next auto_increament value without insertion -


i have table this

|   id   |   name   | |    1   |   alaa   | |    2   |   mohd   | 

and on. id auto increament value.

if delete second row table this

|   id   |   name   | |    1   |   alaa   | 

but auto_increament next value 3.

now need, need next auto increament value codeigniter. don't tell me use

$this->db->insert_id(); 

there no insertion

i need value without insertion.

you can grab information_schema see example below, replace tablename , databasename actual values.

select auto_increment information_schema.tables table_name = 'tablename' , table_schema = 'databasename' 

note: make sure table have auto_increment column, otherwise null.


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -