Quote:
|
Originally Posted by simone
ok, so i've tried everything known to me, plus the million tutorials out there that dont work, to try and paginate my mysql results. If anyone could point my to a simple tutorial that works, or write up a simple code, i'd be so greatful.
Im pulling the data from a table called "eight" and using $perpage as my limitor. Any help guys?
Thanks.
|
Hi there. I couldn't ignore this because that was exactly what I was thinking about. I've been writing a blog script using my leisure time.
Anyways, first off, I thought PEAR's DB class has pager() or something similar that does all the work for you.
If you are not interested, then here's more or less what I did:
Vars explained:
$nav_page_num = ceil(mysql_num_rows($YOUR_RESULT) / $per_page);
$per_page_start = (isset($_GET['sp']) ? $_GET['sp'] : 1);
$get_sp: starting (Nth) post parameter to be passed onto $_GET['sp'].
Of course, you need to add a query function or whatever you need before this.
I'm not a pro-programmer so I'm not sure how good it may sound to some people, but I hope this at least gives you the idea.
Good night,