title: mysql having and where clause on the same query
body: <p>This is the code I have : </p>
  
  <pre><code>$sqlz = "SELECT t1.user_id, t2.status, t2.email 
           FROM coverages t1 
           LEFT JOIN users t2 ON t1.user_id = t2.user_id 
           GROUP BY t1.user_id  
           HAVING COUNT(t1.user_id) =".$value;
  </code></pre>
  
  <p>I would like to add this "<code>WHERE users.email IS NOT NULL</code>"
  When I do add it, it returns a white page /  no results. which I know for a fact there are at least 200 results on the db that contain an email and and match that criteria. </p>
  
  <p>this is an example of what I did that did not work:</p>
  
  <pre><code> $sqlz =    "SELECT t1.user_id, t2.status, t2.email 
               FROM coverages t1 
               LEFT JOIN users t2 ON t1.user_id = t2.user_id
               WHERE users.email IS NOT NULL 
               GROUP BY t1.user_id  
               HAVING COUNT(t1.user_id) =".$value;
  </code></pre>