Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Database Query Failed: right syntax to use near 'LIMIT 1'
23/05/2009
20:02
Avatar
ivanichi
New Member
Members
Forum Posts: 2
Member Since:
23/05/2009
sp_UserOfflineSmall Offline

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)

25/05/2009
03:17
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

27/06/2009
08:08
Avatar
ivanhalen
Member
Members
Forum Posts: 3
Member Since:
26/06/2009
sp_UserOfflineSmall Offline

I had the same problem (maybe you notice that it happens only with JSON data)

Here's what I've done:

  1. 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

  2. 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...
  3. 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!

30/06/2009
21:32
Avatar
potain1
New Member
Members
Forum Posts: 1
Member Since:
30/06/2009
sp_UserOfflineSmall Offline

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

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information