字段填充方式string更改为value 修正mysql驱动一处BUG

This commit is contained in:
thinkphp
2016-02-10 20:50:51 +08:00
parent ebde8513dc
commit b47c455da6
2 changed files with 16 additions and 11 deletions

View File

@@ -50,9 +50,12 @@ class Mysql extends Driver
{
$this->initConnect(true);
list($tableName) = explode(' ', $tableName);
$sql = 'SHOW COLUMNS FROM `' . $tableName . '`';
$result = $this->query($sql);
$info = [];
if (strpos($tableName, '.')) {
$tableName = str_replace('.', '`.`', $tableName);
}
$sql = 'SHOW COLUMNS FROM `' . $tableName . '`';
$result = $this->query($sql);
$info = [];
if ($result) {
foreach ($result as $key => $val) {
$val = array_change_key_case($val);