Breaking

Followers

Tuesday, 18 April 2017

How to get next auto increment value in table

Using Mysql

SHOW TABLE STATUS LIKE 'tablename';

Using Php/Mysql

$query = mysql_query("SHOW TABLE STATUS LIKE 'tablename'");
foreach($query as $query){
$next_id = $query->Auto_increment;
}

No comments:

Post a Comment