how to get only name of columns in mysql table?

Viewed 51

i saw this post MySQL query to get column names? i try to use this code `table name` or DESCRIBE `table name` or SHOW COLUMNS FROM `table name` but return me also a datatype and more in this mode

id  int NO auto_increment

i want only a name id is possible have it ?? thanks somtime is possible bypass qualitystandard ?? please

2 Answers

If you don't like the default output of the SHOW commands, you can get anything you want from the INFORMATION_SCHEMA tables (which is where the SHOW commands get their data too).

SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ?;
Related