X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FDatabase%2FDBStructure.php;h=abbac4e781795a700b10c52c95cbecf0abc0aeb2;hb=3de1fc3097cc7a1e38bf1a0c3cae5ae4ec8067eb;hp=75a5c86241fc63497e3c9fa4f31a73b07eed5733;hpb=38ac615ba0e7ac1f77dc0c15f6e7870671ce5e9b;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); + } }