I'm getting a strange error
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/u921594465/public_html/category.php on line 71 Prev
This is line 71 from my script:
while ($row1 = mysql_fetch_array($query)) {
if (isset($_GET['page'])) {
$page = preg_replace("#[^0-9]#","",$_GET['page']);
} else {
$page = 1;
}
$perPage = 5;
$lastPage = ceil($count / $perPage);
if ($page < 1) {
$page = 1;
} else if ($page > $lastPage) {
$page = $lastPage;
}
$limit = "LIMIT " . ($page -1) * $perPage .", $perPage";
$query = mysql_query("SELECT * FROM post WHERE cat='$nameID' ORDER BY date DESC $limit");
if ($lastPage != 1) {
if ($page != $lastPage) {
$next = $page + 1;
$pagination .= '<a href="/category.php?page='.$next.'">Next</a>';
}
if ($page != 1) {
$prev = $page - 1;
$pagination .= '<a href="/category.php?page='.$prev.'">Prev</a>';
}
}
while ($row1 = mysql_fetch_array($query)) {
//LINE 71 HERE
$output .= $row1['name'] . '<br />';
}