title: MYSQL count(*) returning 1 agaisnt an empty table
body: <p>I am running this query in Codeigniter </p>
  
  <pre><code>$query = $this-&gt;db-&gt;query("SELECT count(*) FROM `friends` WHERE uid=$logged_id AND who=$id")
  </code></pre>
  
  <p>however the table friends is empty, their is nothing inside of it</p>
  
  <pre><code>if($query-&gt;num_rows() &gt; 0) {
   return $query-&gt;num_rows();
  }
  </code></pre>
  
  <p>the query above returns 1, when clearly it should return 0</p>
  
  <p>modifying the query too</p>
  
  <pre><code>$query = $this-&gt;db-&gt;query("SELECT id FROM `friends` WHERE uid=$logged_id AND who=$id")
  </code></pre>
  
  <p>gives me 0, as expected</p>
  
  <p>is their something special about count(*) that I am not aware off?</p>