PHP Classes

File: usage.php

Recommend this page to a friend!
  Classes of Gaidar   Split Result   usage.php   Download  
File: usage.php
Role: Example script
Content type: text/plain
Description: Example of using SplitResult
Class: Split Result
Split MySQL query results between pages
Author: By
Last change:
Date: 20 years ago
Size: 784 bytes


Class file image Download
/* Example of using SplitResult class by Gaidar Magdanurov */

// config file

// splitter class

// connect database
// look into mysql_data.sql fro information about database
mysql_connect($mysql_host, $mysql_user, $mysql_pass);

$result = mysql_query("select * from test_table"); // select data
$sr = New SplitResult($result, $split_by); // init splitter object
if(empty($page)) $page = 1;
$res = $sr->content($page); // get data

// print result
for($i = 0; $i <= (count($res) - 1); $i++){

// print menu
echo '<p align="center">'.$sr->menu($page, './usage.php?page=').'</p>'."\n";