title: MYSQL SELECT with COUNT, FROM, WHERE, GROUP BY
body: <p>I'm having trouble adding a where clause to this query. I would like it to select from where the column 'SAT AM/SUN PM' is 'yes' AND where the column 'confirmed' is 'yes'.</p>
  
  <p>This works without the 'WHERE shift_times='SAT AM/SUN PM'-- it's not outputting anything with this:</p>
  
  <pre><code>        $query = "SELECT position, COUNT(confirmed) FROM volConfirm WHERE shift_times='SAT AM/SUN PM' GROUP BY position"; 
  
      $result = mysql_query($query) or die(mysql_error());
  
      // Print out result
      while($row = mysql_fetch_array($result)){
          echo "There are ". $row['COUNT(confirmed)'] ." ". $row['position'] ." " . $row['shift_times'] . " volunteers.";
          echo "&lt;br /&gt;";
  </code></pre>
  
  <p>A LITTLE MORE INFO: 
  The table contains records that are either confirmed with 'yes' or '0'(for no) and the shift_times are either SAT AM/SUN PM or SAT PM/SUN AM. There are several different positions. I am trying to display the final results like so-ish:</p>
  
  <p>There are: "30" "Art" volunteers for "SAT AM/SUN PM"</p>
  
  <p>There are: "30" "Art" volunteers for "SAT PM/SUN AM"              </p>
  
  <p>Ideally the rows would rotate so the echo under that would be the inverse data for "SAT PM/SUN AM"- but that seems a bit trickier...</p>