Two Laptop Bag*
The moose likes HTML, CSS and JavaScript and the fly likes Pagination Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Pagination Problem" Watch "Pagination Problem" New topic
Author

Pagination Problem

Maya Naga
Ranch Hand

Joined: Nov 09, 2009
Posts: 79
hi ranches,

am developing a application that fetches data from mysql database.
i am using php, javascript for developing and html, css to design.

i have attached a screenshot which describe my page..
The problem am getting is when i click next 10 record the page is initalized to zero though there are records..
can any one suggest me where the problem might be?

here is the code where i fetch records and do paging.




[Thumbnail for sample.png]

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Ever hear of SQL injection attacks? You'll *really* want to look in to that.

By "there are records" what do you mean? That they're in the database, or that they're successfully retrieved from the DB and your loop is wrong? If you run the "next page" query manually, does it work?

How do you go *back* through the records?

Ugh, every time I see PHP I am reminded why I really dislike it as a language.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

This doesn't really seem to be an HTML or JavaScript question, but PHP.
Maya Naga
Ranch Hand

Joined: Nov 09, 2009
Posts: 79
ya the records are fetched from database.
but the problem is it does not work inside tabs.
i need suggestion from you all, how to display it inside the tab as in the screenshot
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Tabs? I don't even recall seeing anything about tabs in the original post.

That would depend on how you're implementing your tabs--I don't see anything in the code you posted about that, so I don't really know how to help other than to point you at the web: there are thousands of pages detailing any of the hundreds of ways there are to implement tabs.

I was serious about the SQL injection--anybody using your page could delete all the records in your database, unless PHP does more under-the-covers now than I remember it doing.
Maya Naga
Ranch Hand

Joined: Nov 09, 2009
Posts: 79
let me give my other php and java script codings where i actually passing the values:

index.php


the above code creates tabs and in extension <td> am calling getCallDetails() function..
following is the javascript coding

CallDetails.js



i think this may help you to figure out my problem...
thank you..
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
When you use innerHTML to add content and it contains script tags, they do not get evaluated. Plus it is also bad to return a full html doc and stick it into the middle of the page. Think what the browser deals with with multiple head, body, and html tags.

Eric
Maya Naga
Ranch Hand

Joined: Nov 09, 2009
Posts: 79
yes thanks eric..
Could you suggest me a solution, Mr.Eric?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Use jQuery, that is my solution.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pagination Problem
 
Similar Threads
Passing values between PHP pages without navigation
get value on click from table using javascript
PHP - MySQL query
Javascript and PHP
google adsense tracker