Is it possible to recieve only the structure of the table even if its emtpy and put the field names in an array. if so wich sql command makes that possible.
thanks Matthy
Is it possible to recieve only the structure of the table even if its emtpy and put the field names in an array. if so wich sql command makes that possible.
thanks Matthy
In Oracle and MySQL, this SQL query will give you the details of the table, including columns and column types:
describe table_name
This may or may not work in other databases.
If you are using MySQL 5.0 or later, you can get the field names from the INFORMATION_SCHEMA.COLUMNS
table.
Something like
SELECT COLUMN_NAME
FROM COLUMNS
WHERE TABLE_NAME = <table_name>
Here is a link to a list of tables in the INFORMATION_SCHEMA database.
thanks for the link the awnser is for example table 'vraag'
SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'vraag'