1){ $where_list = implode('","',$search_list); //$where_list = substr($where_clause,0,strlen($where_clause)-1); } else { $where_list = $search_list[0]; } $sql_count = 'SELECT count(*) FROM search_data WHERE keyword IN ("'.$where_list.'") GROUP BY link'; //echo $sql_count; include('dbcreds.php'); $rs_count = mysql_query($sql_count); $total_results = mysql_num_rows($rs_count); $row_count = 10; if (!(isset($_GET['pagenum']))) $pagenum = 1; else $pagenum = $_GET['pagenum']; //This tells us the page number of our last page $last = ceil($total_results/$row_count); //this makes sure the page number isn't below one, or more than our maximum pages if ($pagenum < 1) { $pagenum = 1; } elseif ($pagenum > $last) { $pagenum = $last; } //This sets the range to display in our query $max = 'limit ' .($pagenum - 1) * $row_count .',' .$row_count; $sql_sponsored = 'SELECT link,description,title FROM search_data WHERE sponsored = 1 AND keyword IN ("'.$where_list.'") GROUP BY link LIMIT 3'; $sql = 'SELECT link,description,title FROM search_data WHERE keyword IN ("'.$where_list.'") GROUP BY link '.$max; $rs = mysql_query($sql_sponsored); if(mysql_num_rows($rs)>0){ echo '
Sponsored Results

'; $j =1; while($line = mysql_fetch_assoc($rs)){ include('results_stub.tpl'); $j++; } } echo '
Web Site Results- Found '.$total_results.' sites for '.$clean_search.'
'; if($total_results >0){ $rs = mysql_query($sql); $j =1; while($line = mysql_fetch_assoc($rs)){ include('results_stub.tpl'); $j++; } } else{ echo "Perhaps try a different search Back"; } if($last != 1){ echo 'Pages: '; for($i=1;$i<($last+1);$i++){ echo ''.$i.' | '; } } } ?>
 Search Again:
 
Admin Control Panel