I may have worded that a bit wrong. Basically I have a report generator that needs to run various reports using an SQL query on a MySQL database and then output the results. With most of the pages I have built in the past using MySQL I reference each variable specifically. For instance…
$row = mysql_fetch_array($result, MYSQL_ASSOC
$row[‘name’], $row[‘status’], etc.
But since this one page will be running various reports on the fly it needs to be able to take the data in the mysql_fetch_array and output it. Just basically… whatever and however many fields the SELECT statement grabs from the database, my code needs to be able to process and create a tab-delimited text file from.
I’m also wondering if there is a way to get the field names into the first row, kind of as a header type row. Example…
name status age
Bob M 27
Lisa S 18
Etc.
Suggestions?