I made some changes and now the "Next" appears at the bottom but the link is staying at the current page instead of going to the next page. Looked thru here for pagination but had no success. Here's what I have w/ the modifications. Thank you.
<?php
foreach($newarr as $value){
$query_value = "SELECT field1,field2,field3 FROM mytable WHERE field1 = '$value' GROUP BY field2 ORDER BY field1 ASC" ;
$num_value=mysql_query ($query_value);
$row_linkcat= mysql_fetch_array ($num_value);
$row_num_links= mysql_num_rows ($num_value);
$titlehigh = preg_replace ( "'($var)'si" , "<FONT style='BACKGROUND-COLOR: #F7DF84'><b>\\1</b></font>" , $row_linkcat[ 'field2' ] );
$linkhigh = preg_replace ( "'($var)'si" , "<FONT style='BACKGROUND-COLOR: #F7DF84'><b>\\1</b></font>" , $row_linkcat[ 'field3' ] );
foreach($trimmed_array as $trimm){
if($trimm != 'b' ){
$titlehigh = preg_replace( "'($trimm)'si" , "<FONT style='BACKGROUND-COLOR: #F7DF84'><b>\\1</b></font>" , $titlehigh);
$linkhigh = preg_replace( "'($trimm)'si" , "<FONT style='BACKGROUND-COLOR: #F7DF84'><b>\\1</b></font>" , $linkhigh);
} //end highlight
}
?>
<p>
<font class="body14">
<a href="index.php?id=<?php echo $titlehigh; ?>"><?php echo $linkhigh; ?></a>
</font><br>
<font class="body12">index.php?id=<?php echo $titlehigh; ?>
</font><br>
</p>
<br>
<?php
} //end foreach $newarr
if($row_num_links_main > $limit){
// next we need to do the links to other search result pages
if ($s>=1) { // do not display previous link if 's' is '0'
$prevs=($s-$limit);
echo "<div align='left'><a href='index.php?id=81?s=$prevs&q=$var&catid=$catid'>Previous " .$limit. "</a></div>";
}
// check to see if last page
$slimit =$s+$limit;
if (!($slimit >= $row_num_links_main) && $row_num_links_main!=1) {
// not last page so display next link
$n=$s+$limit;
echo "<div align='center'><a href='index.php?id=81?s=$n&q=$var&catid=$catid'>Next " .$limit. "</a></div>";
}
}
?>