Uncaught Error: Class 'jqgrid' not found

QuestionsUncaught Error: Class 'jqgrid' not found
Customer asked 2 years ago

I have this error and can´t figure out how to solve it
Im using php 7

database connection
<?php
$db_conf = array();
$db_conf[“type”] = “mysqli”;
$db_conf[“server”] = localhost; // or you mysql ip
$db_conf[“user”] = buho3448_desarro; // username
$db_conf[“password”] = desarrollo3; // password
$db_conf[“database”] = buho3448_econ; // database
// pass connection array to jqgrid()
$g = new jqgrid($db_conf);
?>
 
other file
<?php
include_once(“../../conexion_grid.php”);
include(“/inc/jqgrid_dist.php”);
$db_conf = array(
“type” => PHPGRID_DBTYPE,
“server” => PHPGRID_DBHOST,
“user” => PHPGRID_DBUSER,
“password” => PHPGRID_DBPASS,
“database” => PHPGRID_DBNAME
);
include(“../../lib/inc/jqgrid_dist.php”);
$g = new jqgrid($db_conf);

$col = array();
$col[“title”] = “clave”; // caption of column
$col[“name”] = “clave”; // grid column name, must be exactly same as returned column-name from sql (tablefield or field-alias)
$col[“width”] = “10”;
$cols[] = $col;
$grid[“caption”] = “Sample Grid”;
$grid[“autowidth”] = true;
$grid[“sortable”] = true;
$g->set_options($grid);
$g->select_command = “SELECT * FROM materias”;
// this db table will be used for add,edit,delete
$g->table = “invheader”;
$g->table = “clients”;
$out = $g->render(“list1”);
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”&gt;
<html>
<head>
<link rel=”stylesheet” type=”text/css” media=”screen” href=”lib/js/themes/redmond/jquery-ui.custom.css”></link>
<link rel=”stylesheet” type=”text/css” media=”screen” href=”lib/js/jqgrid/css/ui.jqgrid.css”></link>

<script src=”lib/js/jquery.min.js” type=”text/javascript”></script>
<script src=”lib/js/jqgrid/js/i18n/grid.locale-en.js” type=”text/javascript”></script>
<script src=”lib/js/jqgrid/js/jquery.jqGrid.min.js” type=”text/javascript”></script>
<script src=”lib/js/themes/jquery-ui.custom.min.js” type=”text/javascript”></script>
</head>
<body>
<div>
<?php echo $out?>
</div>
</body>
</html>
?>

Error message
Fatal error: Uncaught Error: Class ‘jqgrid’ not found in /home/buho3448/public_html/econ/prueba_memo.php:14 Stack trace: #0 {main} thrown in /home/buho3448/public_html/econ/prueba_memo.php on line 14

1 Answers
Abu Ghufran Staff answered 2 years ago

It seems like the path of jqgrid_dist.php is incorrect in include/require function.
/home/buho3448/public_html/econ/prueba_memo.php
If you use: include(“/inc/jqgrid_dist.php”);
This means your jqgrid_dist.php is included in “inc” folder on same path as “home”
include(“../../lib/inc/jqgrid_dist.php”);
This means your lib folder is 2 level up, i.e. /home/buho3448/lib …
Please correct include path of lib to make it working.

_________________________
Abu Ghufran - Dev Team
PHP Grid Framework
 
Your Answer

2 + 13 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!