If you do:
describe `table_name`
Mysql will give you table information which will contain field names, their types, etc. What if you want just the field names and nothing else? You can run this query and do just that:
SELECT column_name
FROM INFORMATION_SCHEMA.columns
WHERE table_name = 'tablename'
AND table_schema = 'dbname';
Leave a Reply