I’ve search for the issue, but cant find it, I have a script that gives me this warning Warning: Division by zero in /home/ on line 52.php – you can see the error on http://usedcarsforsaleingauteng.com/
If you look below, $pages = ceil($total / $_GET[p]); // number of pages is line 52.php
Can you guys help please. Thank you
// get total number of entries for pagenation
$result = mysql_query("SELECT COUNT(*) FROM $dblist $where", $link);
$total = mysql_fetch_array($result); $total = $total[0]; // total number of listings
$pages = ceil($total / $_GET[p]); // number of pages
}
You should use
$_GET['p']not$_GET[p](notice the ‘ )I just checked out your website and saw the error. You are not setting the
$_GET['p']variable to a fallback value if it isn’t supplied with the url.When you visit http://usedcarsforsaleingauteng.com/ you see the error, but not with : http://usedcarsforsaleingauteng.com/?p=1
You should have a fallback value: