473,394 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

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
6 1937
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
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
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
can you tell me more about pagination. i don't know what u want to say
me by word pagination

Jul 17 '05 #5
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rudy | last post by:
Hi all, I know this is easy, just can't seem to get it. I have a windows form, and a text box, with a value already in it. I need to add that value to a table. It's just one value, so the entire...
13
by: Jim Carlock | last post by:
I have over a hundred pictures I would like to present. Is it practical to create and parse an array of pictures, picture paths, et al using server-side scripting to accomplish this? I...
3
by: Bob Sanderson | last post by:
I am trying to create a form for a MySQL database similar to a spreadsheet. The idea is to display a list of records, with the last line of the list being an input form. When the user enters data...
9
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
18
by: fishwick | last post by:
I haven't really done any css in quite a while, and am banging my head against the wall trying get the rudimentary layout together of a church website home page to display correctly - I don't want...
1
by: Objectifnet | last post by:
What I really want to do is to be able to link two pages together using an ID, The table involved displays an image stored on the File Server that has the image details stored in the Database called....
5
by: PHPBABY3 | last post by:
Hi, 1. I have two SQL tables. I will call them employees and departments: EMP: LAST_NAME, FIRST_NAME, DEPTNM DEPT: NUM, NAME Input: text string FIND Output: the LAST_NAME, FIRST_NAME...
24
by: Phil Latio | last post by:
Let's say I have a simple web application running with just two MySQL tables. The tables structure is as follows: Table: category category_id (PK) category_name parent_category (FK)...
9
by: tomhawkins1 | last post by:
Hi I currently have a site where users can upload files. These files can be doc, wmv, jpeg, xls, dwf, dwf and dwg. These files are uploaded to /home/**user**/uploads and not /home/...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.