<?
/* Example of using SplitResult class by Gaidar Magdanurov */
// config file
require('config.php');
// splitter class
require('split_result.php');
// connect database
// look into mysql_data.sql fro information about database
mysql_connect($mysql_host, $mysql_user, $mysql_pass);
mysql_select_db($mysql_db);
$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++){
echo '<p>Name: '.$res[$i]['name'].'E-Mail: '.$res[$i]['mail'].'</p>';
}
// print menu
echo '<p align="center">'.$sr->menu($page, './usage.php?page=').'</p>'."\n";
?>
|