I noticed some errors in my paging so to check it I wrote this code using the same filters that I use on my tables .
The first count - $tot_ads should equal the sum of
the other two i.e. $tot_ads1 + $tot_ads2
However they dont !
I get
$tot_ads = 57
$tot_ads1 = 6
$tot_ads2 = 52
A seperate counter also counts 58 ads.
Canu you spot where my problem might be ?
$sql = "SELECT * FROM $section
WHERE confirm = 'y'
AND offwant = '$N_ow'
AND expire_date >= $today
AND city = '$selt_city'".$aug_area.$aug_cat;
$result = mysql_query($sql)
or die ("Could not execute COUNT query.");
$tot_ads = mysql_num_rows($result); // Number of adverts
$sql = "SELECT * FROM $section
WHERE feature != ' '
AND feature != ''
AND confirm = 'y'
AND offwant = '$N_ow'
AND expire_date >= $today
AND city = '$selt_city'".$aug_area.$aug_cat." ORDER BY feature ";
$result = mysql_query($sql)
or die ("Could not execute FEATURE query.");
$tot_ads1 = mysql_num_rows($result); // Number of FEATURE adverts
$sql = "SELECT * FROM $section
WHERE feature = ' '
OR feature = ''
AND confirm = 'y'
AND offwant = '$N_ow'
AND expire_date >= $today
AND city = '$selt_city'".$aug_area.$aug_cat." ORDER BY $sorter";
$result = mysql_query($sql)
or die ("Could not execute MAIN query.");
$tot_ads2 = mysql_num_rows($result); // Number of NON FEATURE adverts
Thanks