驱动改进

This commit is contained in:
thinkphp
2016-05-09 12:01:41 +08:00
parent ae908199eb
commit e7839557c6
5 changed files with 15 additions and 11 deletions

View File

@@ -11,6 +11,7 @@
namespace think\db\connector;
use PDO;
use think\db\Connection;
/**
@@ -42,7 +43,7 @@ class Sqlite extends Connection
list($tableName) = explode(' ', $tableName);
$sql = 'PRAGMA table_info( ' . $tableName . ' )';
$pdo = $this->linkID->query($sql);
$result = $pdo->fetchAll(\PDO::FETCH_ASSOC);
$result = $pdo->fetchAll(PDO::FETCH_ASSOC);
$info = [];
if ($result) {
foreach ($result as $key => $val) {
@@ -72,7 +73,7 @@ class Sqlite extends Connection
. "UNION ALL SELECT name FROM sqlite_temp_master "
. "WHERE type='table' ORDER BY name";
$pdo = $this->linkID->query($sql);
$result = $pdo->fetchAll(\PDO::FETCH_ASSOC);
$result = $pdo->fetchAll(PDO::FETCH_ASSOC);
$info = [];
foreach ($result as $key => $val) {
$info[$key] = current($val);