mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 07:32:48 +08:00
改进断线重连判断
This commit is contained in:
@@ -51,7 +51,6 @@ class Mysql extends Connection
|
||||
*/
|
||||
public function getFields($tableName)
|
||||
{
|
||||
$this->initConnect(false);
|
||||
list($tableName) = explode(' ', $tableName);
|
||||
if (false === strpos($tableName, '`')) {
|
||||
if (strpos($tableName, '.')) {
|
||||
@@ -59,12 +58,8 @@ class Mysql extends Connection
|
||||
}
|
||||
$tableName = '`' . $tableName . '`';
|
||||
}
|
||||
$sql = 'SHOW COLUMNS FROM ' . $tableName;
|
||||
// 调试开始
|
||||
$this->debug(true);
|
||||
$pdo = $this->linkID->query($sql);
|
||||
// 调试结束
|
||||
$this->debug(false, $sql);
|
||||
$sql = 'SHOW COLUMNS FROM ' . $tableName;
|
||||
$pdo = $this->query($sql, [], false, true);
|
||||
$result = $pdo->fetchAll(PDO::FETCH_ASSOC);
|
||||
$info = [];
|
||||
if ($result) {
|
||||
@@ -91,13 +86,8 @@ class Mysql extends Connection
|
||||
*/
|
||||
public function getTables($dbName = '')
|
||||
{
|
||||
$this->initConnect(false);
|
||||
$sql = !empty($dbName) ? 'SHOW TABLES FROM ' . $dbName : 'SHOW TABLES ';
|
||||
// 调试开始
|
||||
$this->debug(true);
|
||||
$pdo = $this->linkID->query($sql);
|
||||
// 调试结束
|
||||
$this->debug(false, $sql);
|
||||
$sql = !empty($dbName) ? 'SHOW TABLES FROM ' . $dbName : 'SHOW TABLES ';
|
||||
$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