mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-05 14:52:47 +08:00
改进断线重连判断
This commit is contained in:
@@ -49,7 +49,6 @@ class Sqlsrv extends Connection
|
||||
*/
|
||||
public function getFields($tableName)
|
||||
{
|
||||
$this->initConnect(false);
|
||||
list($tableName) = explode(' ', $tableName);
|
||||
$sql = "SELECT column_name, data_type, column_default, is_nullable
|
||||
FROM information_schema.tables AS t
|
||||
@@ -58,11 +57,8 @@ class Sqlsrv extends Connection
|
||||
AND t.table_schema = c.table_schema
|
||||
AND t.table_name = c.table_name
|
||||
WHERE t.table_name = '$tableName'";
|
||||
// 调试开始
|
||||
$this->debug(true);
|
||||
$pdo = $this->linkID->query($sql);
|
||||
// 调试结束
|
||||
$this->debug(false, $sql);
|
||||
|
||||
$pdo = $this->query($sql, [], false, true);
|
||||
$result = $pdo->fetchAll(PDO::FETCH_ASSOC);
|
||||
$info = [];
|
||||
if ($result) {
|
||||
@@ -99,16 +95,12 @@ class Sqlsrv extends Connection
|
||||
*/
|
||||
public function getTables($dbName = '')
|
||||
{
|
||||
$this->initConnect(false);
|
||||
$sql = "SELECT TABLE_NAME
|
||||
FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_TYPE = 'BASE TABLE'
|
||||
";
|
||||
// 调试开始
|
||||
$this->debug(true);
|
||||
$pdo = $this->linkID->query($sql);
|
||||
// 调试结束
|
||||
$this->debug(false, $sql);
|
||||
|
||||
$pdo = $this->query($sql, [], false, true);
|
||||
$result = $pdo->fetchAll(PDO::FETCH_ASSOC);
|
||||
$info = [];
|
||||
foreach ($result as $key => $val) {
|
||||
|
||||
Reference in New Issue
Block a user