Get the structure of a table through a query

Asked

Viewed 554 times

1

Through Phpmyadmin, accessing a table, we can see the structure of it in the tab structure listing the fields, the types of data each accepts, and other information.

Captura de Tela

How can I obtain through a query the details of a given table in the database, more specifically its structure, its fields and the type of data that each field accepts?

3 answers

2

Do so:

DESCRIBE tabela;

Or so:

SHOW CREATE TABLE tabela;

2

1


This information may be obtained through information_schema

SELECT * FROM information_schema.columns WHERE table_name = 'nome_da_tabela'

form open:

describe nome_da_tabela

Browser other questions tagged

You are not signed in. Login or sign up in order to post.