Replace "q" calls

This commit is contained in:
Philipp Holzer 2019-03-01 12:35:59 +01:00 committed by Hypolite Petovan
parent be6057b056
commit b2edb85588
5 changed files with 46 additions and 71 deletions

View file

@ -844,4 +844,18 @@ class DBStructure
return $retval;
}
/**
* Returns the columns of a table
*
* @param string $table Table name
*
* @return array An array of the table columns
* @throws Exception
*/
public static function getColumns($table)
{
$r = DBA::p("SHOW COLUMNS FROM `" . $table . "`");
return DBA::toArray($r);
}
}