getColumnsFull() public method

returns detailed array with all columns for given table in database, or all tables/databases
public getColumnsFull ( string $database = null, string $table = null, string $column = null, mixed $link = null ) : array
$database string name of database
$table string name of table to retrieve columns from
$column string name of specific column
$link mixed mysql link resource
return array
コード例 #1
0
ファイル: Table.php プロジェクト: ryanfmurphy/phpmyadmin
 /**
  * Function to get the name and type of the columns of a table
  *
  * @return array
  */
 public function getNameAndTypeOfTheColumns()
 {
     $columns = array();
     foreach ($this->_dbi->getColumnsFull($this->_db_name, $this->_name) as $row) {
         if (preg_match('@^(set|enum)\\((.+)\\)$@i', $row['Type'], $tmp)) {
             $tmp[2] = mb_substr(preg_replace('@([^,])\'\'@', '\\1\\\'', ',' . $tmp[2]), 1);
             $columns[$row['Field']] = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
         } else {
             $columns[$row['Field']] = $row['Type'];
         }
     }
     return $columns;
 }