beginner question: Fatal error: Class 'jqgrid' not found

Questionsbeginner question: Fatal error: Class 'jqgrid' not found
wolfgang asked 11 years ago

hi @all,
excuse my bad english.
i downloaded the latest version and decompressed it to a folder in my webserver directory.
i set the mysql parameters in the php section. nothing else. but i only get the following error:
Fatal error: Class 'jqgrid' not found in D:IPSwebfrontuserMySQLGridsVerbr_Brennholz.php on line 20 (Verbr_Brennholz.php is a copy of index.php)
line 20: $g = new jqgrid();
has anybody an idea whats going wrong?

8 Answers
varun answered 11 years ago

Post Your Setting page in-short

wolfgang answered 11 years ago

<?php
/**
* PHP Grid Component
*
* @author Abu Ghufran <[email protected]> – http://www.phpgrid.org
* @version 1.4.6
* @license: see license.txt included in package
*/

// set up DB ———————————————————————————————–
$conn = mysql_connect("192.168.178.15", "root", "TheMatrix");
mysql_select_db("IPS");

// set your db encoding — for ascent chars (if required)—————————————————-
mysql_query("SET NAMES 'utf8'");

// include and create object
include("/inc/jqgrid_dist.php");

$g = new jqgrid();

// set few params
$grid["caption"] = "Sample Grid";
$grid["multiselect"] = true;
$g->set_options($grid);

// set database table for CRUD operations
$g->table = "tbl_Verbr_Brennholz";

// subqueries are also supported now (v1.2)
// $g->select_command = "select * from (select * from invheader) as o";

// render grid
$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="js/themes/redmond/jquery-ui.custom.css"></link>
<link rel="stylesheet" type="text/css" media="screen" href="js/jqgrid/css/ui.jqgrid.css"></link>

<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/jqgrid/js/i18n/grid.locale-de.js" type="text/javascript"></script>
<script src="js/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="js/themes/jquery-ui.custom.min.js" type="text/javascript"></script>
</head>
<body>
<div style="margin:10px">
<?php echo $out?>
</div>
</body>
</html>

Abu Ghufran answered 11 years ago

Hello,

Please correct the path of jqgrid_dist.php. Set according to this code file directory.

include("/inc/jqgrid_dist.php"); // <– this line need adjustment.

wolfgang answered 11 years ago

Hello Abu,
thanks for your help. The path /inc/jqgrid_dist.php exists.
Now i get
Notice: Undefined index: colNames Error in Script D:IPSwebfrontuserMySQLGridsincjqgrid_dist.php
Same config like before.
I took a look in the file. It beginns with <?php but there is no ?>
The complete Code is in only 1 line with 24242 cols. Is this correct?

varun answered 11 years ago

if yoy have jqgrid_dist.php in IPSwebfrontuserMySQLGridsincjqgrid_dist.php then u need to have all the pages in IPSwebfrontuserMySQLGrids or reset the include("/inc/jqgrid_dist.php");

wolfgang answered 11 years ago

thats exactly what i have. i decompressed the downloaded zip into one folder. i moved nothing. i only work with a copy of index.php.
is it possible to upload a screenshot to proof it?

varun answered 11 years ago

Am sorry since i am also developer like u not the phpgrid support member,not able to view screenshots or something, Please go with the proper absolute path or relative path to post the files,(DO NOT FOLLOW THIS)just to check u have placed grids correctly,paste a copy of inc/jqgrid_dist.php in each of the folders and check,as i said DO NOT FOLLOW THIS for granted it has many faults,just check the path placement correctly by this method.

Abu Ghufran answered 11 years ago

Hello,

For … Notice: Undefined index: colNames Error in Script D:IPSwebfrontuserMySQLGridsincjqgrid_dist.php

Notices can be turned off by adding following lines at top of file.

error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
ini_set("display_errors","off");

This should resolve the issue, as path is fixed as replied in last email.

Thanks Varun for the help.

Your Answer

17 + 7 =

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 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

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

Let us improve this post!

Tell us how we can improve this post?