Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL2000

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-04-03 : 09:50:15
Dean writes "I am programming a website in PHP on a Windows
server. I am using MSSQL 2000 server as my database.
The site I am building is a home rental site.
Basically the site is mostly done but I can't figure
out how exactly to break up my listing onto various
pages. I'm used to connecting to MySQL databases and
there is a command called offset which you can specify
a place in the rows returned that it would start.
Combine that with a 'limit' command ('top' in MSSQL)
and you can just show like homes 30-39. I also want
to list the pages below and send a value on that
offset to the query. I am building the site at:
http://www.we-rent-homes.com and I have two needs to
break up the listing onto pages. One is in the home
listing, and one is in the admin member listing
section. You can see it at:
http://www.we-rent-homes.com/admin/members.php. I
have the basic page counting in place, but I am having
a problem because the data is not consistant. Homes
and members can be deleted so my unique identifier is
not consistant. In other words, there are gaps in the
data so my query can't just be 'WHERE id >=30 AND id <
40'.

My Email address is dean@adoption.com and any help
would be appreciated! Thanks for your input. :)"

Jay99

468 Posts

Posted - 2002-04-03 : 10:24:30
Does this help?

Jay
<O>
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-04-03 : 10:25:23
This should work for you:

http://www.sqlteam.com/item.asp?ItemID=566

It can work even if you don't have an identity or other row-number column in your table.

Go to Top of Page
   

- Advertisement -