function getTableColumnNames($table) { if ($table) { $query = "SHOW COLUMNS FROM " . $table; $res = $GLOBALS['TYPO3_DB']->sql_query($query); $fields = array(); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $fields[] = $row['Field']; } return $fields; } }
Convert MySQL column names to PHP array
- March 30, 2017
- 12:00 am