You need to first return the number of items stored in the table (hint, look up the COUNT() function)

Then you need to limit the results to the specific page you want to display (hint, look up the LIMIT clause)

Then you can output the page numbers by using ceil(TOTAL NUMBER OF RECORDS / 50)

r937
—
2012-06-11T13:20:22Z —
#3

multichild said:

Ive looked on the web, and I cant quite get my head around the code.

there are many fine articles out there on how to do it, and i don't think an impromptu reply on a forum is going to be of higher quality, so you should really pick one of those articles and give it a serious try

cpradio said:

Then you need to limit the results to the specific page you want to display (hint, look up the LIMIT clause)

unfortunately, LIMIT is a proprietary sql feature that exists only in mysql

cpradio
—
2012-06-11T13:33:34Z —
#4

r937 said:

unfortunately, LIMIT is a proprietary sql feature that exists only in mysql

Ah, I knew that. Okay, so instead of limit, you need to research ROW_NUMBER in combination with OVER / PARTITION BY.

multichild
—
2012-06-11T14:47:14Z —
#5

Right, I will see what I can find and take it from there.

It not an easy one this is it?

cpradio
—
2012-06-11T14:56:37Z —
#6

To do it right, no. It is not easy, but once you do it, you won't forget how to do it again

multichild
—
2012-06-11T15:28:32Z —
#7

Ok I have made some in roads here as I did find a tutorial after but it was for php and MySQL, and I need it in MSSQL, but one person replied in a thread on that site and added some changes to accomodate MSSQL, but in honesty Im not sure where he means to put or make the change.