title: Mysqli Group Array Print Count of Group
body: <p>I'm querying my database to group all the similar records and count them.</p>
  
  <p>Here is my current code:</p>
  
  <pre><code>$query= 'SELECT digit_1, count(digit_1) FROM data GROUP BY digit_1 ';
  
  if ($result = mysqli_query($mysqli, $query)) {
  
      /* fetch associative array */
      while ($row = mysqli_fetch_assoc($result)) {
          printf ("%s (%s)\n", $row["digit_1"], $row);
      }
  
      /* free result set */
      mysqli_free_result($result);
  }
  </code></pre>
  
  <p>This results:</p>
  
  <pre><code>0 (Array) 1 (Array) 2 (Array) 3 (Array) 4 (Array) 5 (Array) 6 (Array) 7 (Array) 8 (Array) 9 (Array)
  </code></pre>
  
  <p>How do I get the "count" to print instead of the array?</p>