RE: Paging using PHP and sql server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First, as you might know, you can use "SELECT TOP <n> ... FROM ...", but
that will probably not help you that very much.

But are you able to alter the tables, or do you have a numeric values in
some of the attributes with witch you can do "WHERE ... and <some attribute>
BETWEEN @min AND @max". Unless <some attribute> is in strict order you will
only get aproximatly 1000 records this way.

Another way to do this is (if you are not able to, or don't want to alter
the first table(s)) is to dump the SELECT into another table
like "INSERT INTO <temptable> .. SELECT ...". The <temptable> should then
contain one extra atrtribute. That is an auto incremental key. This will
ensure that you get a full complet ordered set. Aftr this its simple to do a
".. AND <auto key> BETWEEN @FROM AND (@FROM+@MyRANGE)"

An alternative would be - which will be much slower - to define a cursor
that irrerates 1000 times depending on some fragmentation index or FROM_TO
you feed the sp with.

Yet another alternative (just to relate to the PHP list ;) is to read up
everything in an array in PHP and do the same kind of itteration, but with
php - possible using ob_flush() to speed up the output to the browser.

There is more ways, but with this I am sure you spin off and find the
solution that fits you the best.

-----Original Message-----
From: Harpreet
To: 
Sent: 10-3-2004 17:35
Subject: RE:  Paging using PHP and sql server

I am using sql server and it does not support limit funtion

-----Original Message-----
From: David Felton [mailto:davidfelton@xxxxxxxxxxxxxxx]
Sent: Wednesday, March 10, 2004 11:27 AM
To: Harpreet; 
Subject: RE:  Paging using PHP and sql server


Check out this tutorial:

http://www.phpnoise.com/tutorials/9/1

-----Original Message-----
From: Harpreet [mailto:harpreet@xxxxxxxxxxxxxxx]
Sent: 10 March 2004 4:26
To: 
Subject:  Paging using PHP and sql server


I have created a few reports using sql server and PHP. The reports work
just fine except that we have like 19000 records per report. I would like to
do some paging within the reports 1 | 2 | 3 | 4 so that a user can view may
be 1000 records per page and can navigate to other pages if needed.

Help is appreciated

Thanks

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
**********************************************************************

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux