title: Notice: Trying to get property of non-object in with num_rows
body: <p>I'm getting the error:</p>
  
  <blockquote>
    <p>Notice: Trying to get property of non-object.</p>
  </blockquote>
  
  <p>I've been looking into this for a while now and wasn't able to find what's wrong with it, I tried some different ways of syntax(with <code>['']</code> and things like this), but so far without success. I also watched a lot of old questions on SO but they didn't help me either.</p>
  
  <p>My guess would be something is wrong in my query, because if I echo the result before the num_rows, it shows me nothing.</p>
  
  <pre><code>$dbhandle = new mysqli($hostdb, $userdb, $passdb, $namedb);
  
  if ($dbhandle-&gt;connect_error) {
    exit("There was an error with your connection: ".$dbhandle-&gt;connect_error);
  }
  
  $result6 = $dbhandle-&gt;query("SELECT * FROM email WHERE group= 'groupname' ");
  $row_cnt6 = $result6-&gt;num_rows;
  </code></pre>
  
  <p>I hope you can help me out.</p>