PHP Pagination

Pagination is something I always find to be a rather painful and mind-numbing process. Most of the time I am much more concerned about actual processes going on rather than some little links that are just going to make navigation somewhat easier and pageloads smaller. But the fact is that pagination is one of things you need to do and you need to do it right. Ever click on a "next" link on a website and found yourself somewhere you did not intend to go? Or worse than that in my opinion, have you ever been to a website that has a page so long you get bored long before ever even getting close to the content you are looking for? Did it annoy you? Did you ever use that website again? What if that was your website?