I’m trying to get my query results to show up in multiple pages but it is showing a blank page instead. Can you guys help me find the problem?
[code]<?php
$con=mysqli_connect(“address”,“user”,“pass”,“db name”);
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
if (!(isset($pagenum)))
{
$pagenum = 1;
}
$data = mysqli_query($con,“SELECT * FROM info”);
$rows = mysql_num_rows($data);
$page_rows = 15;
$last = ceil($rows/$page_rows);
if($pagenum < 1);
{
$pagenum = 1;
}
elseif ($pagenum > $last);
{
$pagenum = $last;
}
$max = ‘limit ’ .($pagenum - 1) * $page_rows .’,’ .$page_rows;
$result = mysql_query($con,“SELECT * FROM info $max”) or die(mysql_error());
echo "
Creditor | dd/mm/yyyy | Credit Score | State | Income | Approval | Credit Line | Interest | Comment |
---|---|---|---|---|---|---|---|---|
” . $row[‘creditor’] . “ | ”;” . $row[‘date’] . “ | ”;” . $row[‘fako’] . “ | ”;” . $row[‘state’] . “ | ”;” . $row[‘income’] . “ | ”;” . $row[‘approval’] . “ | ”;” . $row[‘creditline’] . “ | ”;” . $row[‘interest’] . “ | ”;” . $row[‘comments’] . “ | ”;
echo " --Page $pagenum of $last--
";
if ($pagenum == 1)
{
}
else
{
echo " <a href=’{$_SERVER[‘PHP_SELF’]}?pagenum=1’> <<-First ";
echo " ";
$previous = $pagenum-1;
echo " <a href=’{$_SERVER[‘PHP_SELF’]}?pagenum=$previous’> <-Previous ";
}
echo " ---- ";
if ($pagenum == $last)
{
}
else {
$next = $pagenum+1;
echo " <a href=’{$_SERVER[‘PHP_SELF’]}?pagenum=$next’>Next -> ";
echo " ";
echo " <a href=’{$_SERVER[‘PHP_SELF’]}?pagenum=$last’>Last ->> ";
}
mysqli_close($con);
?>
[/code]