title: Why does mysqli num_rows always return 0?
body: <p>I've been having trouble getting the number of rows to return using mysqli. I just get 0 back every time even though there are definitely some results.</p>
  
  <pre><code>if($stmt = $mysqli-&gt;prepare("SELECT id, title, visible, parent_id FROM content WHERE parent_id = ? ORDER BY page_order ASC;")){  
      $stmt-&gt;bind_param('s', $data-&gt;id);  
      $stmt-&gt;execute();
      $num_of_rows = $stmt-&gt;num_rows;  
      $stmt-&gt;bind_result($child_id, $child_title, $child_visible, $child_parent);  
  
      while($stmt-&gt;fetch()){
          //code
      }
  
      echo($num_of_rows);
  
      $stmt-&gt;close();
  }
  </code></pre>
  
  <p>Why doesn't it show the correct number?</p>