The only way I know is show create table MyTable
SHOW TABLE STATUS LIKE "tablename";
the auto_increment
column will show the count.
SELECT `AUTO_INCREMENT`
FROM `information_schema`.`TABLES`
WHERE `TABLE_SCHEMA` = SCHEMA()
AND `TABLE_NAME` = 'tbl_name';
You can use LAST_INSERTED_ID
function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With