title: How to use bind_result() instead of get_result() in php
body: <p>I'm working on a project for uni and have been using the following code on a <code>testing server</code> to <code>get all devices</code> from a table based on a <code>user_id</code>:</p>
  
  <pre><code>public function getAllDevices($user_id) {
      $stmt = $this-&gt;conn-&gt;prepare("SELECT * FROM devices WHERE  primary_owner_id = ?");
      $stmt-&gt;bind_param("i", $user_id);
      $stmt-&gt;execute();
      $devices = $stmt-&gt;get_result();
      $stmt-&gt;close();
      return $devices;
  }
  </code></pre>
  
  <p>This worked fine on my testing server but returns this error when migrating over to the university project server:</p>
  
  <pre><code>Call to undefined method mysqli_stmt::get_result()
  </code></pre>
  
  <p>Some googling suggests using <code>bind_result()</code> instead of <code>get_result()</code> but I have no idea how to do this <code>all fields</code> in the table. Most examples only show returning <code>one field</code></p>
  
  <p>Any help would be much appreciated</p>