PHP - Grid view tool for php - Asked By chandana on 05-Dec-11 01:45 AM

Hi..
i need a grid view to display data using php...
pls help me to find a source code of best grid view
Riley K replied to chandana on 05-Dec-11 01:51 AM

Use PHP Datagrid

The basic PHP datagrid requires only as little as five lines of code. Foremostly, always create phpGrid object in the first line; then call its functional methods to define sql

SELECT string, sql table name, sql primary key, and relative path to phpGrid; finally, always call display() to render output to screen.

$dg = new C_DataGrid($hostName, $userName, $password, $dbName);
 
$dg -> set_gridpath   ("include/");
$dg -> set_sql      ("SELECT * FROM Employees");
$dg -> set_sql_table    ("Employees");
$dg -> set_sql_key    ("EmployeeId");
$dg -> display();
Regards
Suchit shah replied to chandana on 05-Dec-11 01:52 AM
For the PHP you can do the Gridview data display by using the Table and using TD and TR of the table or you can also use the DIV to display the data and for pagination you can use some scripting for that
because in PHP TABLE or DIV is the best to display the data
Jitendra Faye replied to chandana on 05-Dec-11 02:01 AM
You have to add the table table tr td within the script that is printing the results from the database.

There is a verygood example using JQUERY, follow the link
http://www.datatables.net/examples/

But it is not based on Ajax, it loads entire data in one shot.

Actual PHP Grid you can find it here
http://www.phpgrid.com/grid/examples/example1.php
kalpana aparnathi replied to chandana on 09-Dec-11 01:11 PM
  1. echo "<table>\n";
  2. foreach($rez as $row){
  3.    echo "<tr>\n";
  4.    foreach($row as $td){
  5.       echo "<td>\n";
  6.       echo $td."\n";
  7.       echo "</td>\n";
  8.    }
  9.    echo "</tr>\n";
  10. }
  11. echo "</table>\n";