title: How to count mysql with using group by PHP?
body: <p>How to count mysql with using group by PHP ?</p>
  
  <p>When i test this code it's echo <code>1</code></p>
  
  <p>How to do for echo <code>3</code> (by count country)?</p>
  
  <p>This is my table_test</p>
  
  <pre><code>_____________________
  |__id___|__country__|
  |__1____|____usa____|
  |__2____|____usa____|
  |__3____|___china___|
  |__4____|____uk_____|
  </code></pre>
  
  <p>This is my code.</p>
  
  <pre><code>&lt;?PHP
  $result = mysql_query("SELECT COUNT(*) FROM table_test GROUP BY country");
  $row = mysql_fetch_row($result);
  mysql_free_result($result);
  $all_country = $row[0];
  echo $all_country;
  ?&gt;
  </code></pre>