RE: Paging using PHP and sql server

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

 



This seems to work preety nice but the only problme i am having is I want to
allow the user to sort by field names .

My sql works just fine without the order by clause.The order by clause keeps
returning the same values.

How can i use an order by clause

my sql is as follows

select top 50 matid,title,comment from table where matid not in (select top
100 matid from table) order by matid desc

Thanks

I am almost there i think.

Thanks for all the help

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


With SQL server you have to do something like
select top $number id from tablename
	...
where id not in (select top $offset id from tablename)

where $number is the number of results you want and $offset is the offset
(surprisingly) The subselect needs to be the same as your main query in
everything but the number of rows you are selecting.

-----Original Message-----
From: Harpreet [mailto:harpreet@xxxxxxxxxxxxxxx]
Sent: 10 March 2004 4:35
To: 
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