cs.punk Posted April 20, 2009 Share Posted April 20, 2009 Hey guys, retrieving the information from that database goes 100% but you can't output all the the results on one page. But how exactly does one go about doing it?... Any ideas? Heres my code: <?php include "files/maintainence_check.php"; include "files/stripslashes_mq.php"; session_start(); include "files/mysqlcon.php"; include "files/filterget.php"; if (!isset($_GET['catid'])) {header("Location: index.php"); } else {$catid = "{$_GET['catid']}"; } $con = mysqli_connect ("$dbhost","$dbuser","$dbpass","$dbname") or die ("Could not connect to server"); $sac = "SELECT * FROM ad_posts WHERE cat_id = '$catid' ORDER BY ad_date DESC"; $e_sac = mysqli_query($con,$sac) or die ("Could not execute \"SELECT * FROM categories\" query." . mysql_error()); echo "<p class=\"smallheading\">"; if (mysqli_num_rows($e_sac) >= 1) {while ($row = mysqli_fetch_assoc($e_sac)) {$date = strtotime("$row[ad_date]"); $row[ad_date] = date("h:i a d/m/y", $date); echo "<a href=\"ads.php?adid=$row[ad_id]\">$row[ad_title]</a> $row[ad_price] ($row[ad_date]) <br/>"; } } else {echo "<p align=\"center\" class=\"smallheading\">Category ID is invalid!</p>"; } echo "</p>"; ?> Link to comment https://forums.phpfreaks.com/topic/154887-select-40-results-and-make-a-second-page-if-more/ Share on other sites More sharing options...
premiso Posted April 20, 2009 Share Posted April 20, 2009 Basic Pagination Link to comment https://forums.phpfreaks.com/topic/154887-select-40-results-and-make-a-second-page-if-more/#findComment-814669 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.