By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,248 Members | 882 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,248 IT Pros & Developers. It's quick & easy.

how to display data from same query on diffrent pages using next link????

P: n/a
when i run query i am getting thousands of records and i am displayaing
a particular no. of records on a single page say 100 records then i put
a link to go on next page. when user clicks on next page the another
100 records will be displayes so should i need to run the query again
to get records from 100 to 200 records ?????

thxs for help in advance.

Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
you need to add a limit to your sql
<?
if(!isset($minQuery) || ($minQuery < 0)){
$minQuery = "0";
}
if(!isset($maxQuery)){
$maxQuery = "100";
}
$sql = "SELECT * FROM table";
$sql .= " LIMIT ".$minQuery.", ".$maxQuery";

?>
on your link to a page add ?minQuery=<? echo $minQuery-100; ?>&maxQuery=<?
echo $maxQuery + 100; ?>
hth
craig

"vishal" <vi************@yahoo.co.in> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
when i run query i am getting thousands of records and i am displayaing
a particular no. of records on a single page say 100 records then i put
a link to go on next page. when user clicks on next page the another
100 records will be displayes so should i need to run the query again
to get records from 100 to 200 records ?????

thxs for help in advance.

Jul 17 '05 #2

P: n/a
On 20 Apr 2005 03:46:58 -0700, vishal wrote:
to get records from 100 to 200 records ?????


http://dev.mysql.com/doc/mysql/en/select.html and use LIMIT.
--
Firefox Web Browser - Rediscover the web - http://getffox.com/
Thunderbird E-mail and Newsgroups - http://gettbird.com/
Jul 17 '05 #3

P: n/a
On 2005-04-20, vishal <vi************@yahoo.co.in> wrote:
when i run query i am getting thousands of records and i am displayaing
a particular no. of records on a single page say 100 records then i put
a link to go on next page. when user clicks on next page the another
100 records will be displayes so should i need to run the query again
to get records from 100 to 200 records ?????


Use the keyword "pagination" for your next websearch.

--
Met vriendelijke groeten,
Tim Van Wassenhove <http://www.timvw.info>
Jul 17 '05 #4

P: n/a
can you tell me more about pagination. i don't know what u want to say
me by word pagination

Jul 17 '05 #5

P: n/a
Take a look at http://www.tonymarston.co.uk/php-mysql/pagination.html

--
Tony Marston

http://www.tonymarston.net
"vishal" <vi************@yahoo.co.in> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
can you tell me more about pagination. i don't know what u want to say
me by word pagination

Jul 17 '05 #6

P: n/a
vishal wrote:
can you tell me more about pagination. i don't know what u want to say me by word pagination


'coz Tim Van Wassenhove thinks that you aren't aware the term used
for that. All (smart) programmers use Google
<http://www.google.com/>--only very few will find difficult in
searching as they may not be knowing the right keyword. So, Tim
provided you with the keyword that you have to use
("pagination")--thinking that you're smart and use or at least will use
Google.

FWIW, <http://www.google.com/search?q=php+pagination>

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.