How to get the name of a column in MySQL even though it has no rows?
How to get the name of a column in MySQL even though it has no rows?
show columns from nome_da_tabela
This is a simple form, this query returns six fields field
(what matters to you), type
, null
, key
, default
and extra
.
For more information, use information_schema.columns
SELECT * FROM information_schema.columns WHERE table_name = 'nome_da_tabela'