The following is a query to retrieve column names from a MySQL table:

SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = ‘table name’;

Share