<?
mysql_connect("localhost", "username", "password");
mysql_select_db("mydatabase");
// You need these to get the page setup right.
$rows = 5;
$start = ($_GET['page'] *5)-1;
// You need to add a limit so you only grab the rows you want
$query="SELECT * FROM floral LIMIT $start, $rows";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<TABLE WIDTH=\"94%\" CELLSPACING=\"4\" CELLPADDING=\"10\" ID=\"product\">\n
<TR>\n<TR><TD ALIGN=\"center\" COLSPAN=\"3\"><h2>Update Floral Tributes</h2>To edit a Floral Tribute please use the <b>\"Link\"</b> on each listing!<hr></TD></TR>";
$i=0;
while ($i < $num) {
$fl_id=mysql_result($result,$i,"fl_id");
$fl_name=mysql_result($result,$i,"fl_name");
$fl_desc=mysql_result($result,$i,"fl_desc");
$fl_pic=mysql_result($result,$i,"fl_pic");
$fl_price=mysql_result($result,$i,"fl_price");
echo "<TR><TD ALIGN=\"center\" VALIGN=\"middle\"><a href=\"image_window.php?fl_id=$fl_id\" onclick=\"window.open(this.href, 'child', 'height=300,width=431'); return false\"><img src=\"img/";echo "$fl_pic\" /></a></TD>\n<TD>\n";echo "<b>$fl_name</b><br><br>$fl_desc<br><br>$fl_price<br><br><hr></TD>\n";
echo "<TD ALIGN=\"center\" VALIGN=\"middle\" width=\"70\"=><a href=\"update_fl.php?fl_id=$fl_id
\" CLASS=\"edit_link\"><b>Up Date</b></a><br><br><a href=\"delete_fl.php?fl_id=$fl_id
\" CLASS=\"edit_link\"><b>Delete</b></a></TD>\n";
$i++;
}
echo "</TR>\n</TABLE>";
?>
<?php
/*
Heres how you do the next and previous links, you can just add it where ever you want them(but it won't know not to show next on the last page, that would take some extra work, as far as i know
*/
if ($_GET['page'] > 2) {
$prev = $_GET['page']-1;
echo "<a href=\"page.php?page={$prev}\">Previous</a>";
}
$next = $_GET['page']+1;
echo "<a href=\"page.php?page={$next}\">Next</a>";
?>
For the next and previous links you'lll need to change page.php to whatever your script is named.