Column headers are usually hardcoded with your custom values. If you don't want to hardcode them into the scrip I would use this approach: create an array mapping db column names to your header names, for example:
$my_headers = [ "desc" => "Description", ... ]
with you headers. You just have to index this array with the value yielded by mysql_field_name
Main Topics
Browse All Topics





by: brodaseatingPosted on 2009-07-13 at 06:16:35ID: 24839339
Hi,
You have right idea with hard-coding it. Often your DB table includes meta-data that you dont want to display - modified on, last updated by, column size etc. A common practice is to choose you display columns ahead of time: Filename, File Size, Format, Submitted By, Duration etc, then loop through your record set populating the appropriate column.
Broda.
Select allOpen in new window