mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
Db类增加RESULTSET_ARRAY RESULTSET_COLLECTION 和 RESULTSET_CLASS 常量
数据库Connection类增加resultSetType属性定义 支持设置数据集返回类型
This commit is contained in:
@@ -54,7 +54,8 @@ class Mysql extends Connection
|
||||
$tableName = str_replace('.', '`.`', $tableName);
|
||||
}
|
||||
$sql = 'SHOW COLUMNS FROM `' . $tableName . '`';
|
||||
$result = $this->query($sql);
|
||||
$pdo = $this->linkID->query($sql);
|
||||
$result = $pdo->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$info = [];
|
||||
if ($result) {
|
||||
foreach ($result as $key => $val) {
|
||||
@@ -81,7 +82,8 @@ class Mysql extends Connection
|
||||
public function getTables($dbName = '')
|
||||
{
|
||||
$sql = !empty($dbName) ? 'SHOW TABLES FROM ' . $dbName : 'SHOW TABLES ';
|
||||
$result = $this->query($sql);
|
||||
$pdo = $this->linkID->query($sql);
|
||||
$result = $pdo->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$info = [];
|
||||
foreach ($result as $key => $val) {
|
||||
$info[$key] = current($val);
|
||||
|
||||
Reference in New Issue
Block a user