PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Ron Darby  >  Database Pagination  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Sample usage
Class: Database Pagination
Paginate database query result listings
Author: By
Last change: Added where explanation
Date: 9 years ago
Size: 565 bytes


Class file image Download


$host = 'localhost';
$dbName= 'db_name';
$user = 'user_name';
$pass = 'db_user_pass';

$db = db::getInstance($host,$dbName,$user,$pass);
$pagination = new pagination($db);

$sql = "SELECT * FROM `table_name`";
$pagination->sql = $sql;

//Example of setting the WHERE clause seperate if you like
$where = "WHERE `timestamp` < '".time()."'";
$pagination->where = $where;

$result = $pagination->result();
$links = $pagination->pager();
//echo $links;

For more information send a message to info at phpclasses dot org.