fix get column name method
This commit is contained in:
parent
d0296933d9
commit
7d5b37236c
|
@ -27,7 +27,8 @@ class DataTableControl extends Database{
|
||||||
|
|
||||||
public function readFields($tableName)
|
public function readFields($tableName)
|
||||||
{
|
{
|
||||||
$sql = "select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='$tableName'";
|
$st=explode('.',$tablename);
|
||||||
|
$sql = "select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where table_schema='".$st[0]."' and TABLE_NAME='".$st[1]."'";
|
||||||
$rs = $this->db->query($sql);
|
$rs = $this->db->query($sql);
|
||||||
return $rs->fetchAll(\PDO::FETCH_COLUMN);
|
return $rs->fetchAll(\PDO::FETCH_COLUMN);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue