Problem with page numbers and my query results. Showing blank page

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 "

";

while($row = mysqli_fetch_array($result)) {
echo “

”;
echo “”;
echo “”;
echo “”;
echo “”;

echo “

”;

echo “

”;
echo “”;
echo “”;
echo “”;
echo “”;
}

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]

Have you tried outputting errors?

[PHP]
ini_set(‘display_errors’,1);
ini_set(‘display_startup_errors’,1);
error_reporting(-1);
[/PHP]

Sponsor our Newsletter | Privacy Policy | Terms of Service