function _paranoiasanitize_get_columns in Paranoia 7
Returns an array of columns in the database for a given table.
Parameters
string $table_name: The table name, with any prefix.
Return value
array Array of columns and some data like the default value.
2 calls to _paranoiasanitize_get_columns()
- drush_paranoiasanitize_paranoia_build_sanitize_whitelist in paranoiasanitize/
paranoiasanitize.drush.inc - Writes baseline sql sanitize whitelist hooks based on current db contents.
- drush_paranoiasanitize_paranoia_sql_sanitize_whitelist in paranoiasanitize/
paranoiasanitize.drush.inc - Callback for `drush paranoia-sql-sanitize-whitelist`.
File
- paranoiasanitize/
paranoiasanitize.drush.inc, line 116 - Drush integration for the paranoiasanitize module.
Code
function _paranoiasanitize_get_columns($table_name) {
$columns = array();
$table_info = db_query("SHOW COLUMNS FROM {$table_name}")
->fetchAll();
foreach ($table_info as $column_info) {
$columns[] = $column_info->Field;
}
return $columns;
}