1
How to take the name of a column in Mysql even if it has no lines?
1
How to take the name of a column in Mysql even if it has no lines?
2
show columns from nome_da_tabela
It is simpler, this 'query' returns six fields field
(what matters to you), type
, null
, key
, default
and extra
.
For details use the information_schema.Columns
SELECT * FROM information_schema.columns WHERE table_name = 'nome_da_tabela'
there is no way to do this with select no
Because I didn’t want to do two layers on the bench
@George u want to take the column names by the array that the database returns? would that be it?
This guy has like
@George without result does not have pq it returns an empty array. You can make a check if returned empty executes the reply query.
guy worked out here
I used show Columns from table name_a_name and set a condition
when select is vario it calls show Columns from tableName
Browser other questions tagged php mysql pdo
You are not signed in. Login or sign up in order to post.
Please don’t write in high box.
– Jéf Bueno