Get a comma-separated string of all column names (Field names) for a given MySQL table.
Useful when working with custom tables.
Method 1: Using $wpdb->get_col()
Method 2: Using $wpdb->get_results()
Example
Note that the implode()
function can accept parameters in any order. Probably best to use it as shown, to maintain consistency with explode()
.
Resources