June 7, 2006
PEAR DB tableinfo();
I needed a quick function in PHP that would generate HTML tables from database information. The issue was that the column names would not be known in advance for some of the more generic queries so I found the solution using the PEAR DB tableinfo() function. This function does exactly what I needed - it "gets info about columns in a table or a query result". Perfect. So I created a function that takes a valid query for your database and formats the results into a nice HTML table, which I find useful for reporting pages (easily imported into Excel or Calc).
Here is the code:
(more...)
Here is the code:
(more...)
