PHP Classes

Data Grid Component: Display MySQL query results in HTML tables

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Info   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2008-02-07 (7 years ago) RSS 2.0 feedNot enough user ratingsTotal: 1,545 All time: 2,415 This week: 1,053Up
Version License PHP version Categories  
data_grid 1.0GNU General Publi...5.0HTML, PHP 5, Databases
Description Author  

This package can be used to display MySQL query results in HTML tables.

It takes a MySQL query result handle and generates an HTML table showing data returned by the query. The query field names are displayed in the table headers.

If there too many result rows, the class can also limit the number of result records that are displayed per page. In that case, the class also displays links to go to pages that display other ranges of the query result.

The table width and height, the cell and navigation link styles are configurable.

Picture of haseeb
Name: haseeb <contact>
Classes: 1 package by
Country: India India
Age: ???
All time rank: 1698100 in India India
Week rank: 1468 Up115 in India India Down

About Datagrid Component

This datagrid component will make life easier for a php programmer by means of generating datagrid on the fly by supplying a few inputs to the datagrid method like width, height, no of records per page, etc

System Requirements
1. Php > 5
2. Mysql
3. Apache 2.0
4. OS - Any

In this component the main class is "" which has the following methods listed below:

       1.DataGrid($w,$h,$lmt,$qResult,$class,$thClass,$linkClass) // Class Constructor

1. DataGrid($w,$h,$lmt,$qResult,$class,$thClass,$linkClass) // Class Constructor
This method is the Datagrid class constructor which consists of the following parameters which has to be initialised during class object initialisation.
                   1.$w - Grid Width
                   2.$h  - Grid height
                   3.$lmt - Specifies how many records per page
                   4.$qResult - This is the mysql query result which has to be passed
                   5.$class    - This parameter takes the class name for the grid
                   6.$thClass - This parameter takes the class name for the grid heading row
                   7.$linkClass - This paramter takes the class name for the navigation links (eg: next, back)
This method will invoke the  GridData($result,$rec_limit) method.

This is the method which most of the grid display functionality. It takes two parameters one the query result and other the limit ie records per page.


                   DBClient.php class is the one which takes care of the db connection and query execution so this class has to be added. 
This class can be used individually for interacting with mysql database. This class supports php version greater than 5

              datagrid.php can be taken as the example for this class. 
  Files folder image Files  
File Role Description
Plain text file Class datagrid class
Accessible without login Plain text file datagrid.php Example datagrid example
Plain text file DBClient.php Class Database Class
Plain text file Class Database Class Interface
Accessible without login Plain text file Readme Doc. Class Documentation

 Version Control Unique User Downloads Download Rankings  
 0%Total:1,545All time:2,415
 This week:0This week:1,053Up