public static function getFields($table) { $db = GenericDao::getConnection(); $alltables = $db->query("SHOW COLUMNS FROM " . $table, \PDO::FETCH_NUM); $tables = array(); while ($result = $alltables->fetch()) { array_push($tables, $result[0]); } return $tables; }