title: can a result of $conn->query(...) be not null with 0 records
body: <p>I came across the following in some old PHP code that I have to work on.  My question is, are both those Ifs required?  In other words, if a result is returned it must have returned greater than zero records, right? And the converse - meaning if $result is False, can I assume that no records have been found?</p>
  
  <pre><code>$sql = "SELECT * FROM houses WHERE ownerphone=$pn";
  $result = $conn-&gt;query($sql);
  if ($result) {
      $count = $result-&gt;num_rows;
      if ($count &gt; 0){
         ....Stuff happens here...
      } else {
          ...What happens here?...
      }
  } else {
       ...Other Stuff happens here
  }
  </code></pre>