]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/DBStructure.php
Replace "q" calls
[friendica.git] / src / Database / DBStructure.php
index 75a5c86241fc63497e3c9fa4f31a73b07eed5733..4732f8d707f1a7d2ad9daee2246a1fe5cadd34d7 100644 (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);
+       }
 }