35 lines
771 B
PHP
35 lines
771 B
PHP
|
<?php
|
||
|
/**
|
||
|
* Created by PhpStorm.
|
||
|
* User: Administrator
|
||
|
* Date: 2014/12/4
|
||
|
* Time: 11:31
|
||
|
*/
|
||
|
|
||
|
namespace Westdc\Visual;
|
||
|
|
||
|
|
||
|
class DataTableControl extends Database{
|
||
|
|
||
|
function __construct()
|
||
|
{
|
||
|
parent::__construct();
|
||
|
}
|
||
|
|
||
|
public function readTables()
|
||
|
{
|
||
|
$sql = "SELECT tablename FROM pg_tables WHERE tablename LIKE 'data_%' ORDER BY tablename ";
|
||
|
$rs = $this->db->query($sql);
|
||
|
|
||
|
$row = $rs->fetchAll(\PDO::FETCH_COLUMN);
|
||
|
return $row;
|
||
|
}
|
||
|
|
||
|
public function readFields($tableName)
|
||
|
{
|
||
|
$sql = "select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='$tableName'";
|
||
|
$rs = $this->db->query($sql);
|
||
|
return $rs->fetchAll(\PDO::FETCH_COLUMN);
|
||
|
}
|
||
|
|
||
|
}
|