Posted: Tue Sep 09, 2003 10:47 am
Look towards the end of my code...
In the "function class_search($cat,$pagelimit)" part, shouldn't I have $start in there somehow? If I change LIMIT $start,$pagelimit to LIMIT 3,$pagelimit, the page starts at the third item. Is in just not being passed dynamically?
Code: Select all
function class_search($cat,$pagelimit)
{
global $query_string;
$table = "classifieds";
$pagelimit = "2";
$strSQL = mysql_query("SELECT * FROM $table");
$totalrows = mysql_num_rows($strSQL);
$pagenums = ceil ($totalrows/$pagelimit);
if ($page==''){
$page='1';
}
$start = ($page-1) * $pagelimit;
$starting_no = $start + 1;
$space = " ";
return snarf_array('classifieds','ID','ID',
" WHERE (Category=$cat OR Category2=$cat OR Category3=$cat) "
. " AND Expires>" . time()
. " ORDER BY Created DESC LIMIT $start,$pagelimit" );
}