Installation

First and foremost, download the phpGrid from the download page, and then extract the zip file somewhere on your web server.

Configuration

Before you begin coding using phpGrid, you must specify database information in conf.php. conf.php is our phpGrid configuration file in which we specify database connection parameters and path to the phpGrid. 

Starting phpGrid version 6, The constant names prefiex with “PHPGRID_” to avoid potential naming collison. Please note that in PHP the method name and parameters are case sensitive.

conf.php for phpGrid version 6 and above (find phpGrid version #):

1
2
3
4
5
6
define('PHPGRID_DB_HOSTNAME','hostname'); // database host name or TNS name (Oracle only)
define('PHPGRID_DB_USERNAME', 'username'); // database user name
define('PHPGRID_DB_PASSWORD', 'password'); // database password
define('PHPGRID_DB_NAME', 'sampledb'); // database name
define('PHPGRID_DB_TYPE', 'mysql'); // database type
define('PHPGRID_DB_CHARSET','utf8'); // OPTIONAL. Leave blank to use the default charset
 

conf.php for phpGrid version 4, 5, 5.x (find phpGrid version #):

1
2
3
4
5
6
define('DB_HOSTNAME','hostname'); // database host name or TNS name (Oracle only)
define('DB_USERNAME', 'username'); // database user name
define('DB_PASSWORD', 'password'); // database password
define('DB_NAME', 'sampledb'); // database name
define('DB_TYPE', 'mysql'); // database type
define('DB_CHARSET','utf8'); // OPTIONAL. Leave blank to use the default charset
Once values in conf.php are set, simply reference phpGrid by adding the following at on top of your PHP code:
 
1
require_once("phpGrid/conf.php"); // relative path to conf.php without leading slash

- or -

1
require_once(realpath($_SERVER["DOCUMENT_ROOT"]) ."/phpGrid/conf.php"); // absolute path to conf.php
 

Database Type

phpGrid supports wide range of database types. Simply define PHPGRID_DB_TYPE parameter value to your own database type. It can be one of the following strings. The default database type for phpGrid is “mysql”. PHPGRID_DB_TYPE string is case sensitive.

PHPGRID_DB_TYPEDescription
mysqlMySQL (default)
odbc_mssqlSQL Server (*nix Only)
odbc_mssql_nativeSQL Server Windows native (Download PHP SQL Server Driver)
oci805Oracle (Got TNS?)
postgresPostGreSql
accessMicrosoft Access
db2DB2
db2-dsnlessDB2 DSN-less connection
informixInformix
informix72Alternative Informix Driver
ibaseFirebird/InterBase
odbcGeneric ODBC

A full list of supported databases and naming convention are available in ADOdb website. Not required but we encourage users to visit ADOdb website. It helps you understand how phpGrid utilizes it under the hood.
new phpGrid now supports local array data source without using a database.

 

PHP Grid Oracle 9, 10g, 11g, 12c

When using PHP datagrid for Oracle database with TNS (Transparent Network Substrate), replace the database host name with the TNS Name in conf.php e.g.

1
define('PHPGRID_DB_HOSTNAME', 'YOUR ORACLE TNS NAME');

No related content found.

Tags: , ,