page splitter

Pagination with PHP and MySQL

Tutorials

In this tutorial I will show you how to take a list of states from a database and break up the states into groups of 10 per page.

Create Database

First we need to create a database that we can extract our data from. I put up a short script you can copy from my google docs, paste it into a php file and run it to create the database table and fields.

For a copy of the database script Click Here...

Open Connection to your Database.

Since we are collecting our data from the database we need to open a connection.

PHP

Pagination Script

In this script we are going to determine how much data we want to display per page.

PHP

Damion Hickman Design, Orange County, CA