Display the fields in a MySQL table..
September18
Simple command that you sometimes need. Obviously this runs from the mysql client prompt, so open a command line and type
mysql -u root -p
and then enter the root password for your mySQL database.
Then, switch to your database…
USE yourdatabasename;
An now, all you need is..
SHOW columns FROM your_table;
OR
SELECT COLUMN_NAME' FROM 'INFORMATION_SCHEMA'.'COLUMNS'
WHERE 'TABLE_SCHEMA'='YOUR_DATABASE'
AND 'TABLE_NAME'='YOUR_TABLE';
Nice.