<?php
require_once('_includes/_includeAll.php');
// get a database connection
$dbConnection = @mysql_connect("localhost", "root", "");
if (!$dbConnection)
die("Could not connect to database");
// select the table
mysql_select_db("mysql", $dbConnection);
try
{
$qp = new QueryPaginator();
$qp->setConnection($dbConnection);
$qp->setResultsPerPage(50);
// set the run
$qp->setQuery("SELECT * FROM help_relation");
// while some records are still available ...
while ($qp->hasNext())
{
// get the current rows in the associative format
$rows = $qp->next(MYSQL_ASSOC);
// display
echo "<pre>";
print_r($rows);
echo "</pre>";
}
}
catch (QueryPaginatorException $q)
{
echo $q;
}
catch (Exception $e)
{
echo $q->getMessage();
}
// close the database connection
@mysql_close($dbConnection);
?>
|