Okey I think I figured it...Somewhat. I am sure there are ways to make this look prettier but this is what I ended up with :
$link = mysql_pconnect("$host", $usr, $pass);
if (!$link)
die("Couldn't connect to MySQL Database");
mysql_select_db($db)
or die ("couldn't open $db: ".mysql_error());
$query = mysql_query("SELECT * FROM word where type = 'search'" );
$total = mysql_num_rows( $query );
$total--;
if (($offset == "") || ($offset < "0") || ($offset > $total))
{
$offset = "0";
$start = ", 1";
}
else
{
$start = ", 1";
}
$query = mysql_query("SELECT * FROM word where type = 'search' LIMIT $offset$start" );
print "<table border=0>\n";
while ( $a_row = mysql_fetch_array( $query ))
{
print "<tr>\n";
print "<td><b>$a_row[title]</b><br><br>$a_row[body]</td>\n";
print "</tr>\n";
}
print "</table>\n";
if ($offset <= "0")
{
print "Back";
}
else
{
$back = $offset - 1;
print "<a href =\"index.php?offset=$back\">Back</a>";
}
if ($offset >= $total)
{
print "forward";
}
else
{
$forward = $offset + 1;
print "<a href =\"index.php?offset=$forward\">Forward</a>";
}
If you would care to critique this slap job code I would be very happy to hear your comments. -- TX