Hi. I get an error which has this written on a popup:
{"page":1,"total":1,"records":"3","rows":[{"InventoryID":"1","IngredientsID":"1","IngredientsInvQty":"100","IngredientTypeID":"2"},{"InventoryID":"1","IngredientsID":"3","IngredientsInvQty":"100","IngredientTypeID":"2"},{"InventoryID":"2","IngredientsID":"2","IngredientsInvQty":"100","IngredientTypeID":"2"}]}
Close
The grid displays but there are no data too. Here is my code
include_once("../phpgrid/config.php");
$db_conf = array();
$db_conf["type"] = "mysqli";
$db_conf["server"] = PHPGRID_DBHOST; // or you mysql ip
$db_conf["user"] = PHPGRID_DBUSER; // username
$db_conf["password"] = PHPGRID_DBPASS; // password
$db_conf["database"] = PHPGRID_DBNAME; // database
// include and create object
include("../phpgrid/lib/inc/jqgrid_dist.php");
$g = new jqgrid($db_conf);
$grid["caption"] = "Inventory";
$grid["autowidth"] = true;
$grid["sortable"] = true;
$g->set_options($grid);
$g->table = "inventory_t";
$out = $g->render("inventory");
echo $out;
Here is the config file
<?php
define("PHPGRID_DBTYPE","mysqli");
define("PHPGRID_DBHOST","localhost");
define("PHPGRID_DBUSER","root");
define("PHPGRID_DBPASS","password");
define("PHPGRID_DBNAME","cakeshopdb");
// Basepath for lib
define("PHPGRID_LIBPATH",dirname(__FILE__).DIRECTORY_SEPARATOR."lib".DIRECTORY_SEPARATOR);
?>