I build the following query and used MySQL's COUNT function in it.
The query is :
SELECT COUNT(`id`) FROM `users` WHERE `gender` = 'Female' AND `sub_by` = 'Self' AND `country` = 'Pakistan' AND `religion` = 'Christian' AND `ma_status` = 'Single' AND `occupation` = 'Unemployed'
Than later in my script I used PHP's functions mysql_result() and mysql_fetch_assoc, and both of them give me error messages, which means the problem is not with the mysql_result() and mysql_fetch_assoc(), but the problem is in the query,
The error messages are:
Warning: mysql_result() expects parameter 1 to be resource, boolean given in C:\wamp\www\practice3\search2.php on line 76
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\wamp\www\practice3\search2.php on line 87
Can anyone tell me what the real problem is in my query.