im making a review section for my site, and i want to generate pages based on amount of data returned by a MySQL query, something like 15 MySQL Rows pr page, i have tried looking in to the $_GET[pageID] approach, but i simply dont get it.
Could someone please elaborate or give me a suggestion? At the moment i echo Sql results in to a div on a reviews.php page.
What i have at the moment is this:
<?php
$con = mysql_connect("localhost", "cencor","cencor");
if (!$con) {
die('<br /><br />Could not connect: ' . mysql_error());
}
function feedbackList() {
mysql_select_db("cencor") or die(mysql_error());
$localIP = $_SERVER['REMOTE_ADDR']; // get IP
$rows = mysql_query("SELECT * FROM feedback WHERE approved=1 ORDER BY sorting DESC");
while ($row = mysql_fetch_array($rows)) {
echo '
<div id="reviews">
<div id="date">'. $row['date'] . "</div> <div id='time'>" . $row['time'] .'</div>
<h2>'. $row['name'] .'</h2>
<br>
<p>'. $row['feedback'] .'</p>
</div>
';
}
}
?>
time and date are set in another script, so no worries there, this code runs fine