You can achieve paging with MySQL's LIMIT
keyword.
You can then use a query string to tell the website which page to get.
First we need to set a default page number and define how many results we want to display in the page:
$items_per_page = 10;
$page = 1;
if(isset($_GET['page'])) {
$page = (int)$_GET['page'];
}
The LIMIT keyword works by providing an offset and the number of rows you want to limit to. So now we need to figure out the offset:
$offset = ($page - 1) * $items_per_page;
Now we have all of the information we need to limit the results correctly based on the page number in our query string:
$query = "SELECT column_1, column_2 FROM your_table LIMIT {$offset}, {$items_per_page};";
$result = mysql_query($query) or die('Error, query failed');
while($row = mysql_fetch_assoc($result)) {
echo $row['column_1'] . '<br />';
}
Now to show your different pages you just add the query string to the end of your page URI.
For example my_page.php?page=1
or my_page.php?page=2
Perhaps you could try to figure out how to create the paging links by yourself and post more if you can't get it to work.
You just need to find out the total rows in your query with COUNT
in MySQL and you can do all of the maths from there ;)