mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
改进Mysql驱动的getFields方法
This commit is contained in:
@@ -51,10 +51,13 @@ class Mysql extends Connection
|
|||||||
{
|
{
|
||||||
$this->initConnect(true);
|
$this->initConnect(true);
|
||||||
list($tableName) = explode(' ', $tableName);
|
list($tableName) = explode(' ', $tableName);
|
||||||
if (strpos($tableName, '.')) {
|
if (false === strpos($tableName, '`')) {
|
||||||
$tableName = str_replace('.', '`.`', $tableName);
|
if (strpos($tableName, '.')) {
|
||||||
|
$tableName = str_replace('.', '`.`', $tableName);
|
||||||
|
}
|
||||||
|
$tableName = '`' . $tableName . '`';
|
||||||
}
|
}
|
||||||
$sql = 'SHOW COLUMNS FROM `' . $tableName . '`';
|
$sql = 'SHOW COLUMNS FROM ' . $tableName;
|
||||||
// 调试开始
|
// 调试开始
|
||||||
$this->debug(true);
|
$this->debug(true);
|
||||||
$pdo = $this->linkID->query($sql);
|
$pdo = $this->linkID->query($sql);
|
||||||
|
|||||||
Reference in New Issue
Block a user