Page 1 of 1

How to find total no. of records in a table having same info

Posted: Sun Dec 21, 2008 10:47 pm
by shahnawaz
Hi,

i just want to find out total no. of records in a table which is having same information in some fields of table mean matching information in the fields. i can elaborate it as suppose i have a survey table which is having 4 answers fields and there are thousands of records in that table, i want to know how many people have given same answers.

Please help me to write db query.
Thanks

Re: How to find total no. of records in a table having same info

Posted: Mon Dec 22, 2008 1:29 am
by jaoudestudios
What do you have so far?

You will need something like this...

Code: Select all

 
$q = "SELECT COUNT(id) AS total FROM *table* WHERE q1 = '".$a1."' AND ....";