0

Hi,

In my project I am developing pagination concept.

but here problem is data is too large so it takes too much time for fetching data.

so anybody can give me solution like fetching data in some part so reduces data fetching time.


Thanks in advance

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by himmat.m4
0

Hi,

In my project I am developing pagination concept.

but here problem is data is too large so it takes too much time for fetching data.

so anybody can give me solution like fetching data in some part so reduces data fetching time.


Thanks in advance

If you are using SQL to query in a more conventional manner then have your query in this form:

SELECT * FROM [YOUR DATABASE].[YOUR TABLE] LIMIT 0,70

This would display every piece of data from 1(after 0) to 70.
Depending on how you want to do it, you can then pass the starting position, 0 in this case as a parameter, preferrably as int, whenever you click on "next page" or "previous page".:

//EXAMPLE
//....more code here...
<%
int pager = 0;
String holdPg = request.getParameter("pg");
if(pg!=null){ pager = Integer.parseInt(holdPg) +1;}

//....display data here passing pager as a parameter
//to be included in your SQL query like this at the end: "SELECT ....LIMIT "+pager+",70";
%>
<form id="x">
<input id="pg" name="pg" type="hidden" value="<%=pager%>" />
<input type="submit" name="btnSubmit" value="next page" />
</form>

This is just to give you an idea and not that it's accurate enough to run from a copy-paste mode.That said, I have used this concept for over 2 years now without a hitch.
Hope this helps!

0

If you are using SQL to query in a more conventional manner then have your query in this form:

SELECT * FROM [YOUR DATABASE].[YOUR TABLE] LIMIT 0,70

This would display every piece of data from 1(after 0) to 70.
Depending on how you want to do it, you can then pass the starting position, 0 in this case as a parameter, preferrably as int, whenever you click on "next page" or "previous page".:

//EXAMPLE
//....more code here...
<%
int pager = 0;
String holdPg = request.getParameter("pg");
if(pg!=null){ pager = Integer.parseInt(holdPg) +1;}

//....display data here passing pager as a parameter
//to be included in your SQL query like this at the end: "SELECT ....LIMIT "+pager+",70";
%>
<form id="x">
<input id="pg" name="pg" type="hidden" value="<%=pager%>" />
<input type="submit" name="btnSubmit" value="next page" />
</form>

This is just to give you an idea and not that it's accurate enough to run from a copy-paste mode.That said, I have used this concept for over 2 years now without a hitch.
Hope this helps!

Thanks for solution

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.