diff --git a/library/think/db/connector/Pgsql.php b/library/think/db/connector/Pgsql.php index 06e08f54..6d653c14 100644 --- a/library/think/db/connector/Pgsql.php +++ b/library/think/db/connector/Pgsql.php @@ -77,6 +77,7 @@ class Pgsql extends Connection */ public function getTables($dbName = '') { + $this->initConnect(true); $sql = "select tablename as Tables_in_test from pg_tables where schemaname ='public'"; // 调试开始 $this->debug(true); diff --git a/library/think/db/connector/Sqlite.php b/library/think/db/connector/Sqlite.php index 1a52905e..95b023e5 100644 --- a/library/think/db/connector/Sqlite.php +++ b/library/think/db/connector/Sqlite.php @@ -74,6 +74,7 @@ class Sqlite extends Connection */ public function getTables($dbName = '') { + $this->initConnect(true); $sql = "SELECT name FROM sqlite_master WHERE type='table' " . "UNION ALL SELECT name FROM sqlite_temp_master " . "WHERE type='table' ORDER BY name"; diff --git a/library/think/db/connector/Sqlsrv.php b/library/think/db/connector/Sqlsrv.php index a8fc5414..18148051 100644 --- a/library/think/db/connector/Sqlsrv.php +++ b/library/think/db/connector/Sqlsrv.php @@ -99,6 +99,7 @@ class Sqlsrv extends Connection */ public function getTables($dbName = '') { + $this->initConnect(true); $sql = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'