驱动改进

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;
/**
@@ -45,7 +46,7 @@ class Pgsql extends Connection
list($tableName) = explode(' ', $tableName);
$sql = 'select fields_name as "field",fields_type as "type",fields_not_null as "null",fields_key_name as "key",fields_default as "default",fields_default as "extra" from table_msg(' . $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) {
@@ -73,7 +74,7 @@ class Pgsql extends Connection
{
$sql = "select tablename as Tables_in_test from pg_tables where schemaname ='public'";
$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);