- i have problem viewing a general search on my database query. on the view report/result i need to create a page-break on every 100rows display and pagination selections; ie: Page 1 2 3 4 5 5...... so on. please help.... thank you
...
<h2>DEPOSIT MANAGEMENT SYSTEM</h2>
<h3><b>VIEW DEPOSITORIES</b></h3>
<a class="hyperlink" href="dep_mgmt_search.php"><b>BACK TO SEARCH FORM</b></a><br>
<a class="hyperlink" href="dep_mgmt_main.php"><b>BACK TO MENU</b></a>
<br><br>
<?php
$sql = 'select * from table_data where 1';
$criteria = '';
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'search') {
foreach($_REQUEST as $key => $value) {
if ($key != 'action') {
if ($value != '') {
$sql .= ' and ' . $key . ' like "%' . $value . '%" ';
$criteria .= $key . '=' . $value . ', ';
}
}
}
}
if ($criteria != '') {
$criteria = substr($criteria, 0, strlen($criteria) - 2);
echo '<b>Search criteria:</b> ' . $criteria . '<br><br>';
}
$qry = $db->query($sql);
if ($qry->num_rows > 0) {
?>
<table width="100%">
<thead>
<tr>
<th><b>NO</b></th>
<th><b>NAME</b></th>
<th><b>NRIC</b></th>
<th><b>CURR BAL</b></th>
<th><b>DATA TYPE</b></th>
<th><b>DATA SUBTYPE</b></th>
<th><b style="color: #0ff;">ACTION</b></th>
</tr>
<tr>
<th colspan="8" style="border-top: 1px solid #fff;"></th>
</tr>
</thead>
<tbody>
<?php
$i = 0;
while ($fetch = $qry->fetch_assoc()) {
$i++;
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo $fetch['NAME']; ?></td>
<td><?php echo $fetch['NRIC']; ?></td>
<td><?php echo number_format($fetch['CURR_BAL'], 2); ?></td>
<td><?php echo $fetch['DATA_TYPE']; ?></td>
<td><?php echo $fetch['DATA_SUBTYPE']; ?></td>
<td><a class="hyperlink" href="dep_mgmt_form.php?id=<?php echo $fetch['ID']; ?>"><b>VIEW</b></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
else {
?>
<br><br><b>DATA NOT FOUND</b><br>Please try again with a new search criteria<br><br>
<?php
}
?>
<br><br><br><br>
<br>
<a class="hyperlink" href="dep_mgmt_search.php"><b>BACK TO SEARCH FORM</b></a><br>
<a class="hyperlink" href="dep_mgmt_main.php"><b>BACK TO MENU</b></a>
<?php
}
include '_template.php';
?> ...
so based on this coding, can anyone help me to rectify where is the problem i'm encounter for the page break for the records view
