I have a SQL Database with customer responses from a PHP survey I setup. One of the questions that is asked is Rate the Quality of Food. The answers can only be from 1-4 (4 being the highest), this answer can't be skipped so there are no null values.
As of Right now I'm building querying the database like this :
$query_qualityFood_4 = "SELECT food_quality FROM surveyData WHERE food_quality = '4'";
$qualityFood_4 = mysql_query($query_qualityFood_4, $results) or die(mysql_error());
$row_qualityFood_4 = mysql_fetch_assoc($qualityFood_4);
$totalRows_qualityFood_4 = mysql_num_rows($qualityFood_4);
This gets tedious because I'am only getting the number of results for answer that equals 4, and I still need to get 3,2,1. Is there any quicker way to get the total number of respondants with one SQL query and put it into an array?
Thanks for the help