Last active
September 9, 2021 16:39
-
-
Save JacquesvanWyk/4c21c5f46084ada6d3828e6be5457c2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$table = DB::select("SELECT AUTO_INCREMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'databaseName' AND TABLE_NAME = 'tableName'"); | |
if (!empty($table)) { echo $table[0]->AUTO_INCREMENT; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT AUTO_INCREMENT | |
FROM information_schema.TABLES | |
WHERE TABLE_SCHEMA = "databaseName" | |
AND TABLE_NAME = "tableName" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment