title: why does count function return one row?
body: <p>I have query like this using PDO</p>
  
  <pre><code>"SELECT category.id AS id, category.static_name AS   static_name,   category.name AS name, COUNT(training.id) AS trainings_count
          FROM category
          JOIN training   ON training.cat_id = category.id"
  </code></pre>
  
  <p>When all columns are empty, the count function returns one row and the whole function return true. So what is the solution for this problem ?</p>