I would like to know how I can take limit my query over multiple pages
$query_flowers = "SELECT id,type,image FROM stock_photography WHERE type='flower'";
$result_flowers = mysql_query($query_flowers) or die("Query Failed: unable to retrieve Photos ".mysql_error());
if (!$result_flowers) {
echo "Unable to execute your selection";
} else {
$num = mysql_num_rows($result_flowers);
$piccols = 3;
$picrows = 1+ round($num / $piccols);
}
echo "<table width='920' border='0' cellpadding='5' cellspacing='0'>";
function display_pics() {
global $num, $result_flowers, $picrows, $piccols;
for ($r=1; $r<=$picrows; $r++) {
echo "<tr>";
for ($c=1; $c<=$piccols; $c++) {
echo "<td align='center' valign='top'>";
$row = mysql_fetch_array($result_flowers);
$photo_id = $row['id'];
$photo_type = $row['type'];
$photo_image = $row['image'];
if (!empty($photo_image)) {
echo "<img src='http://diahannphillips.com/images/stock/$photo_image' border='0'>";
} else {
echo " ";
}
echo "</td>";
}
echo "</tr>";
}
}
display_pics();
echo "</table>";
I would like to limit it to 3 pics per col and have 3 rows visible and then have the the page numbers at the bottom