Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9080021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:58:36+00:00 2026-06-16T19:58:36+00:00

I am using jqgrid with oracle database. The fundamental problem is that seemingly everything

  • 0

I am using jqgrid with oracle database. The fundamental problem is that seemingly everything is correct that not only displays the information in the database table. I leave here all the code that might help me.

book.php

<?php
    //database setting
    $dbuser='system';
    $dbpassword='manager';
    $database='orcl';
    $page = 2;
    // get the requested page
    $limit = 10;
    // connect to the database
    $db = oci_connect($dbuser, $dbpassword, $database) or die("Connection Error: " . oci_error());
    $result = oci_parse($db, 'SELECT COUNT(*) AS count from aaz');
    oci_execute($result);

    $row = oci_fetch_array ($result);
    $count = $row[0];
    if( $count > 0 ) 
    {
         $total_pages = ceil($count/$limit);
    }
    else {
         $total_pages = 0;
    }

    if ($page > $total_pages) $page=$total_pages;
    $start = $limit*$page - $limit; // do not put $limit*($page - 1)
    $SQL = "SELECT * FROM aaz where rownum <=$limit ORDER BY id";
    $result = oci_parse($db, $SQL) or die("Couldn t execute query.".oci_error());    
    oci_execute($result);

    $responce->page = $page;
    $responce->total = $total_pages;
    $responce->records = $count;
    $i=0;
    while($row = oci_fetch_array($result,OCI_ASSOC)) 
    {
        $responce->rows[$i]['id']=$row[ID];
        $responce->rows[$i]['cell']=array($row[ID],$row[FIRSTNAME],$row[LASTNAME],$row[PHONE],$row[EMAIL]);
        $i++;
    }
    echo json_encode($responce);     
?>

index.php

    <html>
<head>
<title>jQGrid example</title>
<!-- Load CSS--><br />
<link rel="stylesheet" href="css/ui.jqgrid.css" type="text/css" media="all" />
<!-- For this theme, download your own from link above, and place it at css folder -->
<link rel="stylesheet" href="css/ui-lightness/jquery-ui-1.8.23.custom.css" type="text/css" media="all" />
<!-- Load Javascript -->
<script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="js/jquery-ui-1.8.23.custom.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-pt.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
</head>
<body>
    ...
<table id="datagrid"></table>
<div id="navGrid"></div>
<p><script language="javascript">
jQuery("#datagrid").jqGrid({
    url:'book.php',
    datatype: 'json',
    colNames:['ID','Nome', 'Apelido', 'Telefone','Email'],
    colModel:[
        {name:'ID',index:'ID', width:155,editable:false,editoptions:{readonly:true,size:10}},
        {name:'FIRSTNAME',index:'FIRSTNAME', width:180,editable:true,editoptions:{size:10}},
        {name:'LASTNAME',index:'LASTNAME', width:190,editable:true,editoptions:{size:25}},
        {name:'PHONE',index:'PHONE', width:160, align:"right",editable:true,editoptions:{size:10}},
        {name:'EMAIL',index:'EMAIL', width:160, align:"right",editable:true,editoptions:{size:10}}
    ],
    rowNum:10,
    rowList:[10,15,20,25,30,35,40],
    pager: '#navGrid',
    sortname: 'no',
    sortorder: "asc",
    height: 210,
    viewrecords: true,
    caption:"Example"
});
jQuery("#datagrid").jqGrid('navGrid','#navGrid',{edit:true,add:true,del:true});
</script>
</body>
</html>

The answer I get is the book.php:

{“page”:2,”total”:2,”records”:”12″,”rows”:[{“id”:”1″,”cell”:[“1″,”fname1″,”lname1″,”(000)000-0000″,”name1@gmail.com”]},{“id”:”2″,”cell”:[“2″,”fname1″,”lname1″,”(000)000-0000″,”name1@gmail.com”]},{“id”:”3″,”cell”:[“3″,”fname1″,”lname1″,”(000)000-0000″,”name1@gmail.com”]},{“id”:”4″,”cell”:[“4″,”fname1″,”lname1″,”(000)000-0000″,”name1@gmail.com”]},{“id”:”5″,”cell”:[“5″,”fname1″,”lname1″,”(000)000-0000″,”name1@gmail.com”]},{“id”:”6″,”cell”:[“6″,”fname1″,”lname1″,”(000)000-0000″,”name1@gmail.com”]},{“id”:”7″,”cell”:[“7″,”fname1″,”lname1″,”(000)000-0000″,”name1@gmail.com”]},{“id”:”8″,”cell”:[“8″,”fname1″,”lname1″,”(000)000-0000″,”name1@gmail.com”]},{“id”:”9″,”cell”:[“9″,”fname1″,”lname1″,”(000)000-0000″,”name1@gmail.com”]},{“id”:”10″,”cell”:[“10″,”fname1″,”lname1″,”(000)000-0000″,”name1@gmail.com”]}]}

Can someone help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T19:58:37+00:00Added an answer on June 16, 2026 at 7:58 pm

    There is a problem with the query for paged data, try changing the query for paging:

    SELECT * FROM 
         (
           SELECT / * + FIRST_ROWS (n) * / *, ROWNUM rnum FROM (our query) 
     WHERE ROWNUM <= limit-sup
         )
     WHERE rnum > = limit-inf;
    

    I hope to help, good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table using jqGrid, I need that when editing a row some
I am using jqgrid.Everything is fine,but a small issue.I am not able to select
I am using jqGrid to display the database table and loading the JQGrid using
I'm using jqGrid and I have a problem getting Dynamic Linq to work. I
I am using jqGrid ( http://www.trirand.com/blog/ ) to display some read-only data. The resizeable
I am using JQGrid to get the date from the RESTFul web services that
Using jqgrid in one of my web applications I found its not working in
Using jqGrid in mvc razor I want a class that can go for jqGrid
I am using jqGrid and I don't want the grid to autoload. I only
So I'm using jqGrid with my mvc.net / Ling2Sql prototype site that I'm making

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.