PHP Classes

File: sample.php

Recommend this page to a friend!
  Classes of Budi Laxono   tGrid   sample.php   Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: Sample file
Class: tGrid
Display database query results in an HTML table
Author: By
Last change:
Date: 15 years ago
Size: 1,146 bytes
 

Contents

Class file image Download
<?php
/* ***************************************************
Sample file to generate datagrid instantly
(c) budi laxono (28-05-2008)

**************************************************** */

include "tableGrid.php";


$dbtype ="mssql";//mssql / mysql / pgsql
$srvname ="mssqlserver";
$dbname ="mssqldb";
$uname ="mssqluser";
$pass ="mssqlpass";
$port ="";
$query = "SELECT * FROM table";
$pk = "table_primary_key";
$srcfield = "table_data_search";
$data_per_page = 5;

/*
$dbtype ="mysql";//mssql / mysql / pgsql
$srvname ="mysqlserver";
$dbname ="mysqldb";
$uname ="mysqluser";
$pass ="mysqlpass";
$port ="";
$query = "SELECT * FROM table";
$data_per_page = 5;
*/
/*
$dbtype ="pgsql";//mssql / mysql / pgsql
$srvname ="pgsqlserver";
$dbname ="pgsqldb";
$uname ="pgsqluser";
$pass ="pgsqlpass";
$port ="";
$query = "SELECT * FROM table";
$data_per_page = 5;
*/


$grid = new TableGrid($dbtype, $srvname, $dbname, $uname, $pass, $port);

//$grid->create_table($query);
//$grid->create_paging_table($query, $pk, $data_per_page);
$grid->create_data_search($query, $srcfield, $pk, $data_per_page);

?>