Hello,
I'm using the following code to pull links out of a database (in a particular category) and display them to the user...sorta like Yahoo! :
<?php
$HTTP_GET_VARS[´SubCat´];
$HTTP_GET_VARS[´Location´];
$db = mysql_connect("xxx", "xxx");
mysql_select_db("xxx",$db);
if ($Location) {
$result = mysql_query("SELECT URL, SiteName, Description FROM backcountry WHERE SubCategory = ´$SubCat´ AND Location = ´$Location´ AND Status <> ´HIDDEN´ ORDER BY SiteName",$db);
} else {
$result = mysql_query("SELECT URL, SiteName, Description FROM backcountry WHERE SubCategory = ´$SubCat´ AND Status <> ´HIDDEN´ ORDER BY SiteName",$db);
}
?>
.
.
Some HTML Stuff
.
.
.
</TD>
</TR>
<tr><td>
<ul>
<?php
if ($myrow = mysql_fetch_array($result)) {
do {
printf("<LI><A HREF=\" %s \">%s</A> - \"%s\"\n", $myrow["URL"], $myrow["SiteName"], $myrow["Description"]);
} while ($myrow = mysql_fetch_array($result));
echo "</ul>";
echo "</td></tr>";
echo "</table>";
.
.
.
More HTML Stuff
.
.
.
} else {
echo "Sorry, no records were found!";
}
?>
As it stands now, this code simply presents ALL the links that match the particular query...and can be over 100 links at times. What I would like to do is figure out a way to only show the, say, first 25 links, and then create links at the bottom of the list that will show the next 25, then the next, and so on...much like most search engines do it. Being new to PHP, I really have no idea how to do this, and would love a push in the right direction.
Thanks!
Mark