note 117222 deleted from function.mysql-insert-id by cmb
| From: | cmb@php.net | Date: | Sun, 16 Feb 2020 13:34:08 +0000 |
| Subject: | note 117222 deleted from function.mysql-insert-id by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-214124@lists.php.net to get a copy of this message | ||
Note Submitter: mrtbsr at hotmail dot com
----
Get current AUTO_INCREMENT value for any table
example:
$table=$db->prepare("SHOW TABLE STATUS FROM -DatabaseName-");
$table->execute();
$sonuc = $table->get_result();
while ($satir=$sonuc->fetch_assoc()){
if (isset($satir["Name"])== "-TableName-"){
$ai[$satir["Name"]]=$satir["Auto_increment"];
}
}
echo $ai["-TableName-"];