0?$_GET["page"]:1; $start = $limit * ($page - 1); $stmt = $conn->prepare("SELECT * FROM forums ORDER BY date DESC LIMIT $start,$limit"); $stmt->execute(); foreach($stmt->fetchAll() as $post){ makePost($post); } //checking if there would be results on the next page $row = $start+$limit; $stmt = $conn->prepare("SELECT * FROM forums ORDER BY date DESC LIMIT $row,1"); $stmt->execute(); $moreResults = $stmt->rowCount(); ?> ":"
"; echo $moreResults?"":"
"; ?>