• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Pagination Problem

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

sample.png
[Thumbnail for sample.png]
Call Reader
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This doesn't really seem to be an HTML or JavaScript question, but PHP.
 
Maya Naga
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes thanks eric..
Could you suggest me a solution, Mr.Eric?
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use jQuery, that is my solution.

Eric
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic