hello i need help with this code as i cant get it to work this is the code
this is the line thats given me problems in it
$pages = ceil(mysqli_result($pages_query,0)/$per_page);
<?php include('styles/top.php'); ?> <div id="full">
<div id="view_box">
<ul>
<li><img src="images/1.png" /></li>
<!-- <li><img src="pics/2.jpg" /></li> -->
<!-- <li><img src="pics/3.jpg" /></li> -->
</ul>
</div>
<div id="button">
<ul>
<!-- <li><button class="button" scroll_value="0">*</button></li> -- >
<!-- <li><button class="button" scroll_value="600">*</button></li> -->
<!-- <li><button class="button" scroll_value="1200">*</button></li> -->
</ul>
</div>
<hr /><br />
<?php
if (($user_level !=1) && ($user_level !=2)){
echo "No Access Allowed";
} else {
$per_page = 8;
$pages_query = mysqli_query($link,"SELECT COUNT(`id`) FROM(`orders`) WHERE OrderBy = '$username'");
$pages = ceil(mysqli_result($pages_query,0)/$per_page);
if (!isset($_GET['page']))
{
echo "<meta http-equiv='refresh' content='0;url=view.php?page=1'>";
}
else
{
$page = $_GET['page'];
}
$start = (($page - 1)*$per_page);
?>
<h3>View Orders</h3>
<table border=1">
<tr>
<th>FULL NAME </th>
<th>DATE GOT </th>
<th>PAY DATE</th>
<th>MONEY DUE</th>
<th>UPDATE ORDER STATUS</th>
</tr>
<tr>
<td> </td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<?php
error_reporting(0);
$result = mysqli_query($link,"SELECT * FROM orders WHERE OrderBy = '$username' AND Status = 'Layon' LIMIT $start,$per_page");
$totmoney = 0;
$strmoney = "";
while ($myrow = mysqli_fetch_array($result))
{
$strmoney = $myrow["Money"];
$strmoney = str_replace(',','',$strmoney);
if(is_numeric($strmoney))
{
settype($strmoney, "float");
$strmoney = number_format($strmoney, 2);
}
echo "<TR><TD><a href=\"_view.php?id=".$myrow['id']."\">".$myrow["FullName"]."</A> </TD><TD>".$myrow["GotDate"]." </TD><TD>".$myrow["PayDate"]." </TD><TD>£".$strmoney." </TD>";
echo "<TD><center><a href=\"update_order.php?id=".$myrow['id']."\"><img class=\"displayed\" alt=\"View\" src=\"images/edit.png\" width=\"175\" height=\"25\" /></a></center></TD>";
echo "</TR>";
$totmoney = $totmoney + (int)$myrow["Money"];
}
?>
<tr>
<td> </td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td> </td>
<td>TOTAL DUE</td>
<td>£<?=number_format($totmoney, 2);?> </td>
<td></td>
<td></td>
</tr>
</table>
<br />
<?php
echo "<center>";
for ($number=1;$number<=$pages;$number++)
{
echo '<a href="?page='.$number.'">'.$number.'</a> | ';
}
echo "<br/><br/><font color='white'>Current Page: $page</font>";
echo "</center></br>";
?>
<?php
}
?>
</div>
<?php include('styles/bottom.php'); ?>