Re: [PHP] Database Paging using MSSQL 2000

2001-02-24 Thread Manuel Lemos

Hello Ankur,

On 21-Feb-01 06:09:04, you wrote:

>I am implementing a database application using PHP4 and MSSQL2000. I have a
>database table which has a large no. of tuples. I want to display the data in
>the form of pages with Prev Next buttons.

>I wanted to know if there is some syntax in the MSSQL Select statement which
>can allow me to limit the no. of records being returned. I am lookin at
>functionality which is similar to LIMIT in Mysql.

>for ex, LIMIT 10,10  in MYSQL returns to me a maximum of 10 records starting
>from the 10th record in the returned recordset.

>is there any similar functionality available in MSSQL.

You need to use server side cursors.  You may want to look how that is done
in Metabase, a PHP database independent package that has a function
MetabaseSetSelectedRowRange($database,$first,$limit) that may be used
before executing a query and it works like if you are using the
LIMIT $first,$limit query of MySQL.

You may want get Metabase for free here:

http://phpclasses.UpperDesign.com/browse.html/package/20

You may also want to look into this Query result table display class that
uses this Metabase feature to display query results split in pages:

http://phpclasses.UpperDesign.com/browse.html/package/130

Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
--
E-mail: [EMAIL PROTECTED]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Database Paging using MSSQL 2000

2001-02-23 Thread Richard Lynch

>I wanted to know if there is some syntax in the MSSQL Select statement
which can allow me to >limit the no. of records being returned. I am lookin
at functionality which is similar to >LIMIT in Mysql.

Look up "cursor" in your MS SQL documentation.

It's not as mind-numbingly simple as LIMIT, but it works.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Database Paging using MSSQL 2000

2001-02-21 Thread Ankur Verma

Hello All!

I am implementing a database application using PHP4 and MSSQL2000. I have a database 
table which has a large no. of tuples. I want to display the data in the form of pages 
with Prev Next buttons.

I wanted to know if there is some syntax in the MSSQL Select statement which can allow 
me to limit the no. of records being returned. I am lookin at functionality which is 
similar to LIMIT in Mysql.

for ex, LIMIT 10,10  in MYSQL returns to me a maximum of 10 records starting from the 
10th record in the returned recordset.

is there any similar functionality available in MSSQL.

if not, how should I go about implementing this functionality.

I would also appreciate if someopone could point me to a good tutorial on the subject 
using MSSQL server as the database server.

best regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India