hi,
i want to add more details in one page.this is not server side details.just i am using only table to show these details.i want to divide these details in one or more pages in one page.Like
page 1 2 3...
in this place how to use paging.

Recommended Answers

All 2 Replies

You can find many tutorials on paging, however, I find the best paging to be done through querystrings. You use a simple command line in the querystring, let's say p for page, request the querystring and set the page equal to that. Then, within your SQL, limit the amount of records you get taken in, and start at a new point within the records. In MySQL, it would look something like this:

"SELECT * FROM Users ORDER BY UserName LIMIT " & numRecsPerPage & ", " & (((pageNum-1)*numRecsPerPage)+1)

Now you obviously need more validation, to stop users from typing in letters or allowing negative numbers, in order to prevent an error (have it default to 1).

This would just grab the next amount of records starting at a certain point. I would recommend keeping them ordered. This way you only retrieve the amount of records you need.

i am using only html.i found one solution thats virtual paging using script.its working good.
Using that script divide my large page into chunks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.