MeekroDB Quick Start Docs FAQ
Download GitHub

Misc Methods

DB::useDB()

Switch to a different database.

DB::useDB('my_other_database');

DB::tableList()

Get an array of the tables in the requested database. If no database is specified, use the current database.

$current_db_tables = DB::tableList();
$other_db_tables = DB::tableList('other_db');

foreach ($other_db_tables as $table) {
  echo "Table Name: $table\n";
}

DB::columnList()

Get an array of the columns in the requested table in the current database.

$columns = DB::columnList('accounts');

foreach ($columns as $column) {
  echo "Column: $column\n";
}

DB::disconnect()

Drop any existing MySQL connections. If you run a query after this, it will automatically reconnect.

DB::disconnect(); // drop mysqli connection

DB::get()

Return the underlying mysqli object.

$mysqli = DB::get();