title: how to get value of bind_result() on another page
body: <p>on <code>db_handler.php</code> page</p>
  
  <pre><code>public function getAllUserList($user_id) {
      $stmt = $this-&gt;conn-&gt;prepare("SELECT list_id,name,date_created FROM list  WHERE user_id = ?");
      $stmt-&gt;bind_param("i", $user_id);
      $stmt-&gt;execute();
      $list = $stmt-&gt;bind_result($list_id,$name,$date_created);
      $stmt-&gt;close();
      return $list;
  }
  </code></pre>
  
  <p>on <code>index.php</code> </p>
  
  <pre><code>$result = $db-&gt;getAllUserList($user_id);
  while ($result-&gt;fetch()) {
              $tmp = array();
              $tmp["id"] = $list_id;
              $tmp["list_name"] = $name;
              $tmp["createdAt"] = $date_created;
              array_push($response["lists"], $tmp);
          }
  </code></pre>
  
  <p>its giving fatal error </p>
  
  <blockquote>
    <p>PHP Fatal error:  Call to a member function fetch() on a non-object</p>
  </blockquote>
  
  <p>previously I was using <code>$stmt-&gt;get_result()</code> method instead of bind_result but it start throwing error </p>
  
  <blockquote>
    <p>PHP Fatal error:  Call to undefined method
    <code>mysqli_stmt::get_result().</code></p>
  </blockquote>
  
  <p>if I use  <code>while ($result-&gt;fetch())</code> on <code>dbhandler.php</code> page it working fine. but it gives error on <code>index.php</code></p>