Verification: a143cc29221c9be0

Paging in php with demo

Paging in php with demo

Paging Script : php_paging.zip

Open the sql file to create your table, then enter your database login details at config.php file.
config.php : Enter your database details
demo_paging1.php : Demo script showing 10 records per page
demo_paging2.php : Demo script showing how users can select number of records per page
demo_paging4.php : Demo script showing how users can select sorting or records by column link
sql_student_dump.txt : SQL dump to create table with records

Download   php_paging.zip

Advance PHP Paging Script : advance_php_paging.zip

config.php : Enter your database details
php_paging.php : Demo script to display two step paging of records
sql_student_adv_dump.txt : SQL dump to create table with records

Download   advance_php_paging.zip

Paging Script using Ajax : ajax-paging-v1.zip

Open the sql file to create your table, then enter your database login details at config.php file.
config.php : Enter your database details
php_paging-ajax-demo.php : Demo script using Ajax to display records
php_paging-ajaxck.php : Backend PHP script returning records
mysql-dump.txt : SQL dump to create table with records

Download   ajax-paging-v1.zip

The CSS:

This will need to go preferably in your style sheet, or else in your document head between the style tags.

First we'll create a containing div with the id 'pagination' and add a 40px margin top and bottom to give some space above and below.

/* The pagination container div: */
#pagination{
position:relative;
margin:40px 0;
}

Then we need to create the styling for the navigation buttons and create a class to hide the navigation buttons if there's no more than one page.
We also need to create an 'active' class to underline the number on the active page button:

Now we need to add some basic responsive styling for our articles:

/* The article container: */
.article{
margin:20px 0;
padding:40px 0;
border-bottom:1px solid #ccc;
}

/* The artical image floated left: */
.article img{
float:left;
left:0;
width:100%;
max-width:300px;
margin:auto 30px 15px auto;
}

/* Then we need a clear fix to clear the floated image: */
.clearfix{
clear:both;
}

The MySQL database:

In the demo and download we have a database named 'pagination', with a table set up as follows:

  1. Name: id | type: INT | length: 3 | Auto_Increment
  2. Name: image | type: VARCHAR | length: 10
  3. Name: title | type: VARCHAR | length: 140
  4. Name: description | type: VARCHAR | length: 600

Simple pagination with php and mysql - table settings