Forum Moderators: coopster
What I want done is so that say after 15 links to profiles are on a page, they will start moving to page 2, then 3 like the forum topics do. I was just wondering if anyone could point me in the right direction, where I could look at how to create somthing like this. I only want somthing very basic, pretty much just enough to get the job done.
Thanks.
eg.
$resultsPerPage = 30;
$pageNum = $_GET["pageNum"];
$query = "SELECT * FROM table LIMIT ".($pageNum*$resultsPerPage).", ".(($pageNum*$resultsPerPage) + $resultsPerPage)."";
or something similar.
Ally
[In the URL, (for the second page for example) should partly look like the following:
www.example.com/results.php?page=2
// This tells which page you are trying to acess
$page = $_REQUEST['page'];
//Getting the end value, assuming you will have 30 list on a page
$page_end = $page * 30;
// Getting the beginning number
$page_begin = $page_end - 29;
//Setting the Query
$query = "SELECT * FROM table LIMIT ". $page_begin .", ". $page_end;
This might help.
Habtom