Forum


20:02

23/05/2009

I've try jqgrid_demo.zip
I have problem, look this script :
20 // rowNum parameter in the grid
21 $limit = $_REQUEST['rows'];
and then
42 // calculation of total pages for the query
43 if( $count >0 ) {
44 $total_pages = ceil($count/$limit);
45 } else {
46 $total_pages = 0;
}
information on browser :
Warning: Division by zero in C:\\AppServ\\www\\ok\\example.php on line 44
Couldn't execute query.You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
anybody help me ???
(Utilising Appserv 10 : PHP/5.2.6 Server)
03:17

Moderators
30/10/2007

Hello,
Maybe you set the rowNum parameter in your script to zero.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
08:08

26/06/2009

I had the same problem (maybe you notice that it happens only with JSON data)
Here's what I've done:
- Opening directly in the browser the "example.php" page gave me the same error with a couple of warning about "undefined index": something like:
Notice: Undefined index: sord in D:\\Web\\php\\demo\\example.php on line 27
Warning: Division by zero in D:\\Web\\php\\demo\\example.php on line 45
Couldn t execute query.You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 - I added a querystring to see if the file was working (the page needs some input data to initialize it):
http://path_to_file/example.ph.....38;rows=10
well, the JSON data was there, at the bottom of the page, but still had the "undefined index" notifications: then I started thinking that these notifications could be bad for the "example.html" page to read JSON data... - I suppressed all the warning and notifications adding the line:
ini_set('display_errors', 0);
at the top of the example.php page: it works!!!
So, for me the key was to use the script as in a production environment, without warning and displaying errors: hope it can help!
21:32

30/06/2009

Hi
I too am having a similar problem with example.php usind PHP and MySQL - followed the instructions in the demo. The error message is exactly the same as ivanhalen's but refers to line 42:
// calculate the total pages for the query
if( $count > 0 ) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
Any help would be greatly apprecaited. (Using XAMPP on XP Home)
Thanks you
Most Users Ever Online: 715
Currently Online:
59 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66