July 10th, 2000, 10:39 AM
At the moment i'm trying to do a function to retrieve data and place it in an HTML table.
I was going to try to generate the table dynamically depending on the amount of columns in the table being searched. This would basically mean having the first row of the table with the names of the MySQL fields in them.
FOr example, I have several tables in a database, each with a different amount of data fields. I would like to generate an HTML table with the amount of columns contained in that MySQL table, headed with the names of those MySQL data fields, and containing the results of the query passed into that MySQL table....
DO you know of a way of doing this ? At the moment I am using a DB access class similar to that described in the "Accessing Databases with Class" article on this site....
but i haven't found a way of retrieving the columns names of the table columns.... Any ideas ?
July 10th, 2000, 10:58 AM
see mysql_fetch_fields() in the PHP manual