改进数据库驱动的getFields方法 支持指定别名的情况 修正model类一处错误

This commit is contained in:
ThinkPHP
2013-04-30 10:45:38 +08:00
parent 7cfdde0ab7
commit 64f7e1d3ca
7 changed files with 8 additions and 3 deletions

View File

@@ -42,6 +42,7 @@ class Mysql extends Driver{
*/
public function getFields($tableName) {
$this->initConnect(true);
list($tableName) = explode(' ', $tableName);
$sql = 'SHOW COLUMNS FROM `'.$tableName.'`';
$result = $this->query($sql);
$info = [];