title: mysqli_stmt_get_result alternative for php 5.2.6
body: <p>I am not an expert of php, I developed a small service which query a mysql db.</p>
  
  <p>However I developed with php 5.4, and then discovered that my web hosting plan has 5.2.6, so I am having few problems with some undefined function.</p>
  
  <p>Specifically, in this case, how can I solve the mysqli_stmt_get_result undefined function available on > 5.3 ? Here is the code:</p>
  
  <pre><code>  $stmt = mysqli_prepare($con,$db_query);
  
    if($stmt) {
  
       mysqli_stmt_bind_param($stmt,'ss',$after,$lang);
       mysqli_stmt_execute($stmt);
       $result = mysqli_stmt_get_result($stmt); // &lt;-- getting undefined error here !!!
  
       $updated = array();
       $deleted = array();
  
       while($row = mysqli_fetch_assoc($result)) {
  
          if($row['status']==1) {
             array_push($updated,$row);
          } else {
             $cardName=$row['cardName'];
             $cardStatus=$row['status'];
             $cardId=$row['cardId'];
             $language=$row['language'];
             array_push($deleted,array(
                      'cardName'=&gt;$cardName,
                                      'status'=&gt;$cardStatus,
                                      'cardId'=&gt;$cardId,
                                      'language'=&gt;$language
                                 )
             );
          }
       }
  
       $response = array(
          'cards'=&gt;array(
             'updated'=&gt;$updated,
             'deleted'=&gt;$deleted
          )
       );
  
       $json = json_encode($response);
       mysqli_close($con);
       echo $json;
  
    }
  </code></pre>
  
  <p>The point is that I am using a prepared statement, due to my lack of php knowledge I found no other way of resolving the issue without rewriting the whole script.</p>
  
  <p>I thought that some of you may have a simple and easy solution.</p>