i have table name is ads
like that:
id ad_country ad_gender ad_birthday
1 UK Male 2012-02-26
2 sangapor Female 2011-05-29
3 UK Female 2010-04-12
and i have two drop down select options
one is to select country
and
one is to select year
is it possible to make one sql query which affine the results to get :
how many male in every country selected and by the year selected also. how many female in every country and by the year selected also thx
i have tried this sql but didnt work.
SELECT COUNT(ad_gender) AS male FROM ads WHERE '".$_POST['country']."' = ad_country AND ad_gender = Male AND '".$_POST['year']."' = '".$row2['ye']."'
note that $row2['ye'] is from $sql2 as follows
SELECT ad_birthday,(substr(ad_birthday , 1, 4)) AS ye FROM ads
EDITED my post as its not much code i gave , here my new question my new post