title: Mysqli get_result alternative
body: <p>I've just changed all my sql queries to prepared statements using mysqli. To speed this process up I created a function (called <code>performQuery</code>) which replaces <code>mysql_query</code>. It takes the query, the bindings (like "sdss") and the variables to pass in, this then does all the perpared statement stuff. This meant changing all my old code was easy. My function returns a <code>mysqli_result</code> object using mysqli <code>get_result()</code>.</p>
  
  <p>This meant I could change my old code from:</p>
  
  <pre><code>$query = "SELECT x FROM y WHERE z = $var";
  $result = mysql_query($query);
  while ($row = mysql_fetch_assoc($result)){
      echo $row['x'];
  }
  </code></pre>
  
  <p>to</p>
  
  <pre><code>$query = "SELECT x FROM y WHERE z = ?";
  $result = performQuery($query,"s",$var);
  while ($row = mysql_fetch_assoc($result)){
      echo $row['x'];
  }
  </code></pre>
  
  <p>This works fine on localhost, but my web hosting server does not have mysqlnd available, therefore <code>get_result()</code> does not work. Installing mysqlnd is not an option.</p>
  
  <p>What is the best way to go from here? Can I create a function which replaces <code>get_result()</code>, and how?</p>