DB::columnList() now returns details

This commit is contained in:
Sergey Tsalkov
2021-06-15 21:39:19 -07:00
parent 38545ddb3a
commit dab71efacd
3 changed files with 26 additions and 10 deletions

View File

@@ -363,7 +363,19 @@ class MeekroDB {
}
public function columnList($table) {
return $this->queryOneColumn('Field', "SHOW COLUMNS FROM %b", $table);
$data = $this->query("SHOW COLUMNS FROM %b", $table);
$columns = [];
foreach ($data as $row) {
$columns[$row['Field']] = [
'type' => $row['Type'],
'null' => $row['Null'],
'key' => $row['Type'],
'default' => $row['Default'],
'extra' => $row['Extra']
];
}
return $columns;
}
public function tableList($db = null) {