<?php
/**
* this is an example which splits the query results into multiple totalpages as search engine does
* you can change the query and format in which the result is being printed
*/
session_start();
$page = $_REQUEST['page'];
if ($_REQUEST['sql'])$_SESSION['sql'] = $_REQUEST['sql'];
if ($_REQUEST['line'])$_SESSION['line'] = $_REQUEST['line'];
if ($_REQUEST['fieldRequire'])
$_SESSION['fieldRequire'] = true;
else
$_SESSION['fieldRequire'] = false;
$sql = $_SESSION['sql'];
include("database/DbData.php");
if (!$_SESSION['line'])
$line = 10;
else
$line = $_SESSION['line'];
echo "<b>Page No: " . $page . "</b>";
if (!$sql) {
$sql = $conn->sql;
}
$connDB = $conn->connect($sql, $line); //create an object of split pass the sql and total no of rows to be displayed in a page
if ($conn->errMsg != "") {
die($conn->errMsg);
}
$rows = $conn->getQuery($page);
$conn->showTable($rows, $_SESSION['fieldRequire']);
$conn->pageFooter($page);
?>
|