Folks, I am trying to use php to read a flat file and display the output as an HTML table. So far I have been able to make the initial header row display and they are sortable but the data rows are just references to an array with no contents. Can anybody show me where I am going wrong?
<?php $sortby = $_SERVER['QUERY_STRING']; $set = ''; if ($sortby == '') { $header = 'Item Number'; $sortby = 'itemnumber'; $set = 'y'; } if ($sortby == 'Item Name') { $header = 'itemname'; $set = 'y'; } if ($sortby == 'Item Description') { $header = 'idescript'; $set = 'y'; } if ($sortby == 'Item Type') { $header = 'itemtype'; $set = 'y'; } if ($sortby == 'Item Color') { $header = 'itemcolor'; $set = 'y'; } if ($sortby == 'Item Size') { $header = 'itemsize'; $set = 'y'; } if ($sortby == 'Item Price') { $header = 'itemprice'; $set = 'y'; } if ($set == '') { echo 'The variable at the end of the web address did not match one required by the code. Please check the web address for errors.'; exit; } Bob's Database Read <?php echoBobs Database
To sort the columns click on the headers.
View the database
Item Number | Item Name | Item Description | Item Type | Item Color | Item Size | Item Price |
---|