PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Barida Popsana  >  Simple Pagination  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: How to use
Class: Simple Pagination
Generate links to browse paginated listings
Author: By
Last change: Added more comments
Date: 4 years ago
Size: 991 bytes


Class file image Download
require_once "";
$max_rows = 12; //Maximum number of rows to be fetched from the database..
$page_url = "index.php?option=com_spg&view=sentMessages";
$pn = new pagination($no_vouchers,$max_rows);
$db_limit = $pn->getLimit()); //Returns db limit e.g 0, 12;
    //Add the limit to your database query..
$db = new mysqli( "hostname", "username", "password", "dbname" );
$sql = "SELECT * FROM `products` LIMIT " . $db_limit . ";";
$queried = $db->query( $sql );
<table style='width: 100%'>
<?php while( $fetch = $queried->fetch_assoc() ): ?>
        <?php echo "<td>" . implode("</td>\n<td>", $fetch) . "</td>\n"; ?>
<?php endif; ?>
= $pn->getLink($page_url, $target); //Specifying $target Returns a Hashed link which invokes a javascript function called loadPn..
    //If not specified, it returns a raw hyperlink which;
$data .= "<span class='right'>" . $pn->getPageLength() . "</span>";