I'm not sure I did the FOUND_ROWS correctly see $noRecs? I enclose my sql statement with the filters and limit. I need the total $noRecs for paging without the limit but when I echo the $noRecs I get the number 1 which might be the page instead.? And the $noPages is 0.01 which is right. The number of records on this query is 21 .
$sql="SELECT SQL_CALC_FOUND_ROWS bu, cart_id, ndc, error_flag, item_id, description, upc, ndc_uom, std_uom ";
$sql.="FROM inventory, link ";
$sqlWhere="WHERE ndc=ndc ";
if ($bu!=''){ $sqlWhere.="AND bu ='$bu' ";}
if ($cart_id !='') { $sqlWhere.="AND cart_id='$cart_id' ";}
if (($zoneid !='') && ($zonenm!='')) { $sqlWhere.="AND zoneid ='$zoneid'AND zonenm='$zonenm' ";}
if ( $error_flag !=''){$sqlWhere.="AND error_flag='$error_flag' ";}
$sqlOrder="ORDER BY $order ";
$sql.=$sqlWhere;
$limit_start= ($page * PAGE_LIMIT) - 100;
$sqlLimit= "LIMIT $limit_start,100 ";
$noPages=$noRecs/1
$sql.= $sqlOrder ." " .$sqlLimit ;
$result= mysql_query($sql);
if ( !$result ) {die("<font color='red'>Invalid query:</font>" . mysql_error() . "<br />$sql");}
$noRecs= mysql_num_rows(mysql_query('SELECT FOUND_ROWS()'));
echo "Number of Recs :$noRecs";