title: Preferred way to check if query is successful
body: <p>When checking if a query was successful, what is better? </p>
  
  <p>This</p>
  
  <pre><code>$query= "SELECT * FROM `table`"; 
  $mysqliResult = $mysqli-&gt;query($query);
  
  if(mysqli_num_rows($mysqliResult)) {
  
  }
  </code></pre>
  
  <p>Or this:</p>
  
  <pre><code>$query= "SELECT * FROM `table`"; 
  $mysqliResult= $mysqli-&gt;query($query);
  
  if(get_resource_type($mysqliResult) === 'mysqli result') {
  
  }
  </code></pre>