title: Optimize PHP Mysql Count Function
body: <p>I count MySQL rows using this function:</p>
  
  <pre><code>function sqlcount($table)
  {
       $sql = mysql_query("SELECT COUNT(0) FROM $table;");
       $sql = mysql_fetch_array($sql);
       return $sql[0];     
  }
  </code></pre>
  
  <p>Print the result:</p>
  
  <pre><code>echo sqlcount("members"); 
  </code></pre>
  
  <p>But this does not work and does not show the true count. What is the problem?</p>