7.5 Archives | phpGrid - PHP Datagrid Create PHP grids in minutes, not hours. Fri, 29 Nov 2024 23:39:04 +0000 en-US hourly 1 CodeProjecthttps://wordpress.org/?v=7.0.3 129966043 Data Source: Stored Procedure with IN Paramters https://phpgrid.com/example/data-source-stored-procedure-with-in-paramters/ Sun, 15 Aug 2021 01:44:55 +0000 https://phpgrid.com/?p=9779

* This feature is only available with a commercial license.   phpGrid now supports stored procedure (version 7.5+). It works with stored proc without parameters; and stored proc with IN parameter(s). Stored proc with OUT parameter currently is not directly supported, but possible by using local array as a workaround. It’s easy to use. Pass […]

The post Data Source: Stored Procedure with IN Paramters appeared first on phpGrid - PHP Datagrid.

]]>

* This feature is only available with a commercial license.

 

phpGrid now supports stored procedure (version 7.5+). It works with stored proc without parameters; and stored proc with IN parameter(s). Stored proc with OUT parameter currently is not directly supported, but possible by using local array as a workaround.

It’s easy to use. Pass the stored proc name as 1st parameter into the phpGrid constructor. And parameter values as the 2nd (must be the same order defined in stored proc). You only need those two parameters.

Stored proc with no parameter

1
2
3
// stored proc with 2 in parameters
$dg = new C_DataGrid("CALL GetTotalAssets()");
$dg -> display();

Stored proc with 2 IN parameters

1
2
$dg = new C_DataGrid("CALL GetOfficeByCountryState(?, ?)", ['USA', 'CA']);
$dg -> display();

Yeap, it’s that easy. No muss, no fuss.

Keep in mind to always include namespace and conf.php on TOP of the script.

1
2
use phpCtrl\C_DataGrid;
require_once("/file/path/to/conf.php");

The post Data Source: Stored Procedure with IN Paramters appeared first on phpGrid - PHP Datagrid.

]]>
9779