You can dynamically grab the columns on your table using the INFORMATION_SCHEMA.
SELECT COLUMN_NAME from INFORMATION_SCHEMA.columns where TABLE_SCHEMA = "your_database" AND TABLE_NAME = "your_table"