MySql get fields of table
snippet in sql

get the mysql table columns data type mysql

user7581

SHOW COLUMNS FROM mydb.mytable;

MySql get fields of table

user3937

SELECT COLUMN_NAME
  FROM INFORMATION_SCHEMA.COLUMNS
  WHERE TABLE_SCHEMA = 'my_database' AND TABLE_NAME = 'my_table';

mysql show table fields

user7515

DESCRIBE my_table;