Read on because I'm sure it's a completely simple job for one of you guys.
OK, so here's my script that pages results. It works just fine. See here: http://shit-list.org/search.php
and here it is before I edited it to fit my site: http://codewalkers.com/tutorials/4/5.html
<?PHP
include "db.php";
$start=$_GET["start"];
if(!isset($start)) $start = 0;
$query = "SELECT * FROM `shitlist` ORDER BY `lastname` ASC LIMIT " . $start . ", 10";
$result = mysql_query($query)
or die("couldn't connect to shitlist");
$query = "SELECT count(*) as count FROM `shitlist`";
$resultCount = mysql_query($query)
or die("couldn't connect to shitlist");;
$row = mysql_fetch_array($resultCount);
$resulttwo = mysql_query("SELECT * FROM `shitlist` ORDER BY `lastname` ASC LIMIT " . $start . ", 10");
$numrows = $row['count'];
$temp=ceil(($numrows/10)+1);
if($numrows > ($start + 10))
{
echo " <a href=\"" . $PHP_SELF . "?start=" . ($start + 10) . "\"><b>Next >></b></a> | ";
}
$temp3=0;
for($temp2 = 1; $temp2 < $temp; $temp2++)
{
echo "<a href=\"" . $PHP_SELF . "?start=" . ($temp3) ."\">";
if($temp3==$start)
{
echo "<b>$temp2</b></a> | ";
}
else
{
echo "$temp2</a> | ";
}
$temp3=($temp3+10);
}
if($start > 0)
echo "<a href=\"" . $PHP_SELF . "?start=" . ($start - 10) . "\"><b><< Previous</b></a> ";
while($myrow = mysql_fetch_array($resulttwo))
{
echo "<br><br><font face=Verdana size=1 color=#ffffff><b>".strip_tags($myrow["firstname"])." ".strip_tags($myrow["lastname"])."</b><br><font face=Verdana size=1 color=#FFFFFF>".strip_tags($myrow["city"])." ".strip_tags($myrow["state"]);
echo "</font><font color=#999999 face=Verdana><font size=1><br><b>Asshole description: <br></b>".strip_tags($myrow["reason"])."</font><br><br>";
}
if($numrows > ($start + 10))
{
echo " <a href=\"" . $PHP_SELF . "?start=" . ($start + 10) . "\"><b>Next >></b></a> | ";
}
$temp3=0;
for($temp2 = 1; $temp2 < $temp; $temp2++)
{
echo "<a href=\"" . $PHP_SELF . "?start=" . ($temp3) ."\">";
if($temp3==$start)
{
echo "<b>$temp2</b></a> | ";
}
else
{
echo "$temp2</a> | ";
}
$temp3=($temp3+10);
}
if($start > 0)
echo "<a href=\"" . $PHP_SELF . "?start=" . ($start - 10) . "\"><b><< Previous</b></a> ";
?>
and now, here is the search code:
http://codewalkers.com/tutorials/9/15.html
I've been working my ass off to combine the two, but have just come up with errors. I'm a total php newbie, so chances are it's a 2 minute job for you guys. Please help!! I'll return the favor to php newbs in the future!