title: mysqli_num_rows() expects parameter 1 to be mysqli_result, object given
body: <p>I'm having an issue with the warning "mysqli_num_rows() expects parameter 1 to be mysqli_result, object given", I'm trying to display content from a database and it seems to be working fine except for this warning. I've tried a lot of methods to fix this but it does not seem to be working. The warning tells me that the line with the problem is "if(mysqli_num_rows($result)>0) {", hope you can help me shed some light on this. Thanks.</p>
  
  <pre><code>&lt;?php
  $sql = "SELECT `id`, `name`, `type`, `size`, `url`, `owner`, `created` FROM `files`";
  $result = $db-&gt;query($sql);
  if($result) {
      if(mysqli_num_rows($result)&gt;0) {
          echo "You have not uploaded any files.";
      } else {
          echo "  &lt;table width='100%'&gt;";
          echo "
      &lt;tr&gt;
        &lt;td&gt;Name&lt;/td&gt;
        &lt;td&gt;Type&lt;/td&gt;
        &lt;td&gt;Size&lt;/td&gt;
        &lt;td&gt;URL&lt;/td&gt;
        &lt;td&gt;Owner&lt;/td&gt;
        &lt;td&gt;Created&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
      &lt;/tr&gt;";
          while($row = $result-&gt;fetch(PDO::FETCH_ASSOC)) {
              echo "
      &lt;tr&gt;
        &lt;td&gt;{$row['name']}&lt;/td&gt;
        &lt;td&gt;{$row['type']}&lt;/td&gt;
        &lt;td&gt;{$row['size']}&lt;/td&gt;
        &lt;td&gt;{$row['url']}&lt;/td&gt;
        &lt;td&gt;{$row['owner']}&lt;/td&gt;
        &lt;td&gt;{$row['created']}&lt;/td&gt;
        &lt;td&gt;&lt;a href='file?id={$row['id']}'&gt;Download&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;";
          }
          echo "
    &lt;/table&gt;
  ";
      }
  }
  ?&gt;
  </code></pre>