Multiple databases Archives | phpGrid - PHP Datagrid Create PHP grids in minutes, not hours. Sat, 10 Oct 2015 11:57:30 +0000 en-US hourly 1 CodeProjecthttps://wordpress.org/?v=7.0.3 129966043 Reference to Multiple Databases * https://phpgrid.com/example/multiple-databases-support/ Tue, 29 Mar 2011 18:23:02 +0000 http://phpgrid.com/?p=1316 * Please note this feature is only available in paid versions. phpGrid nows supports data source from more than one database on a single page. Simply use the 4th parameter in constructor (C_DataGrid) to overwrite the initial database settings in conf.php. In the following example, grid A binds a table from one database, while grid […]

The post Reference to Multiple Databases * appeared first on phpGrid - PHP Datagrid.

]]>
* Please note this feature is only available in paid versions.

phpGrid nows supports data source from more than one database on a single page. Simply use the 4th parameter in constructor (C_DataGrid) to overwrite the initial database settings in conf.php.

In the following example, grid A binds a table from one database, while grid B binds another table from a completely different database, all on the same page.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$gridA = new C_DataGrid("SELECT * FROM orders", "orderNumber", "orders");
$gridA->enable_edit("INLINE","CRUD");
$gridA -> display();

// overwrite database settings with another database.
$gridB = new C_DataGrid("SELECT * FROM names", "id", "names",
                        array("hostname"=>"localhost",
                            "username"=>"USER2",
                            "password"=>"PASSWORD",
                            "dbname"=>"utf8db",
                            "dbtype"=>"mysql",
                            "dbcharset"=>"utf8"));

$gridB->enable_edit("INLINE","CRUD");
$gridB -> display();

The post Reference to Multiple Databases * appeared first on phpGrid - PHP Datagrid.

]]>
1316