Usually there’s more to displaying tabular data than just putting it in a table. If you have large data sets, you might like to add user interface controls like column sorting or paging to your tables, so that your users can easily digest the content in small chunks.
The PEAR Structures_DataGrid class is more than capable of handling the job.9 Structures_DataGrid has more features than I can list here—we’ll only be using a few of them in our solution, which builds an HTML table with column sorting and paging controls. This solution also requires several PEAR packages to function properly. They are: Structures_DataGrid_DataSource_MDB2, 10 MDB2_Driver_mysql, 11 Structures_DataGrid_Renderer_HTMLTable, 12 and Structures_DataGrid_Renderer_Pager. 13 Once we’ve made sure all those PEAR packages are installed, we can get started on the solution
The PEAR Structures_DataGrid class is more than capable of handling the job.9 Structures_DataGrid has more features than I can list here—we’ll only be using a few of them in our solution, which builds an HTML table with column sorting and paging controls. This solution also requires several PEAR packages to function properly. They are: Structures_DataGrid_DataSource_MDB2, 10 MDB2_Driver_mysql, 11 Structures_DataGrid_Renderer_HTMLTable, 12 and Structures_DataGrid_Renderer_Pager. 13 Once we’ve made sure all those PEAR packages are installed, we can get started on the solution
<?php
require 'dbcred.php';
require 'Structures/DataGrid.php';
require 'dbcred.php';
require 'Structures/DataGrid.php';