Skip to content

Instantly share code, notes, and snippets.

@JacquesvanWyk
Last active September 9, 2021 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JacquesvanWyk/4c21c5f46084ada6d3828e6be5457c2d to your computer and use it in GitHub Desktop.
Save JacquesvanWyk/4c21c5f46084ada6d3828e6be5457c2d to your computer and use it in GitHub Desktop.
$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; }
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