<?php
//usage
//include mypagin.php;
require_once ('mypagin.php');
//for sql syntax to get total_record number
$sql = "SELECT COUNT(column_id) FROM tablename" ;
$total_records = $row [0];
//create a pagin class
$pagin=new simplepagin();
// assign variable values
$pagin->total_records=$total_records;
$pagin->noperpage=5;
//this would give example.php?page=1 url type
$pagin->url='example.php';
$pagin->val='page';
//pagin size (sm or lg )
//for default pagination size leave value empty like this $pagin->size=''
$pagin->size='sm';
//call the pagin function
$pagin->pagin();
|