X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FDatabase%2FDBStructure.php;h=abbac4e781795a700b10c52c95cbecf0abc0aeb2;hb=ce3b1210640ce653ef91cbf033788474c1f88b0c;hp=75a5c86241fc63497e3c9fa4f31a73b07eed5733;hpb=83f49fcf15c29263f1448b728d60245b90f847fa;p=friendica.git diff --git a/src/Database/DBStructure.php b/src/Database/DBStructure.php index 75a5c86241..abbac4e781 100644 --- a/src/Database/DBStructure.php +++ b/src/Database/DBStructure.php @@ -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) + { + $stmtColumns = DBA::p("SHOW COLUMNS FROM `" . $table . "`"); + return DBA::toArray($stmtColumns); + } }