What type of pagination
Prev 1 2 3 4 Next or
Prev Next?
Anyway the basics of pagination is have one Query that gathers the information limited and a second query without the limited parameter.
From there your second query is what will be worked with.
So count the number of rows there are, than divide the total rows by the limit
so the formula
page = total / limit
From there is IF statements
So firstly the previous link
if (($page-$limit) != 0) {
//do previous
}
#Now the Next Link
if(($page+$limit)<$numrows) {
//do next link
}
I havent tested it but its the basics of what is required.
I hope that helps just a little