ASP - using same variable over two pages?
Here is what I am trying to do.
I have a list of data that builds a table. This list is very long and I want to split it over many pages. Its a rankings list so I would like to have no1 to no50 on the first page, then have a link to no51 to no100, then a link to 101 to 150 etc..
Do I just make the recordset or array on the first page like I normally would, then on the next page just use it as if I had created it on that page? Or do I have to create that variable again on each page?
Hope I made that clear enough. I just want to do what search engines do. Split up search results over many pages.
Thank you,
_Nathan.
Mark Hensler posted this at 08:30 — 18th May 2001.
He has: 4,048 posts
Joined: Aug 2000
Where is your data comnig from? a database? If so, we can use the recordset object to pagenate the results for you.
ShinNathan posted this at 08:40 — 18th May 2001.
They have: 46 posts
Joined: Dec 2000
It is a recordset... What is pagenate?
ShinNathan posted this at 08:52 — 18th May 2001.
They have: 46 posts
Joined: Dec 2000
Another quick question while I am here.
In SQL, can you tell it to select say, the first 20 results instead of selecting all or selecting by criteria?
For example I could say:
SELECT 20 FORM thisTable WHERE this ='that'
Thanks
Nasanu.org
Mark Hensler posted this at 18:22 — 18th May 2001.
He has: 4,048 posts
Joined: Aug 2000
"In SQL, can you tell it to select say, the first 20 results instead of selecting all or selecting by criteria?"
Yes... msSQL:
SELECT TOP 20 * FROM table_name WHERE ID>=40 ..blah blah blah
mySQL:
SELECT * FROM table_name WHERE... blah blah .... LIMIT 40,20
The mySQL query will return 20 records starting with record 40. The msSQL query will return 20 records starting with the record whose ID is 40. There not the same, but close.
pagenate... make into pages
Some links that may help:
http://msdn.microsoft.com/library/partbook/asp20/apagedresultsetexample.htm
http://msdn.microsoft.com/library/default.asp?URL=/library/wcedoc/adoce31/ado30ref_6.htm
http://msdn.microsoft.com/library/psdk/indexsrv/ixuwebqy_1mxx.htm
Mark Hensler
If there is no answer on Google, then there is no question.
ShinNathan posted this at 09:13 — 19th May 2001.
They have: 46 posts
Joined: Dec 2000
Thank you very much
_Nathan.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.