title: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4294967296 bytes)
body: <p>My project uses an open source PHP MySQL library <a href="https://github.com/ajillion/PHP-MySQLi-Database-Class" rel="noreferrer">https://github.com/ajillion/PHP-MySQLi-Database-Class</a></p>
  
  <p>But the project mid-year report: "Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4294967296 bytes) in / home1/flipalbu/public_html/kvisofttest/login-admin/Lib/class.MysqliDb.php on line 422" This error ,</p>
  
  <p>My server is: linux x86_64</p>
  
  <p>PHP Version 5.4.17</p>
  
  <p>Mysql Version: 5.5.32</p>
  
  <p>memory_limit = 128M</p>
  
  <p>Line 422:<code>call_user_func_array (array ($ stmt, 'bind_result'), $ parameters);</code></p>
  
  <p>Query part of the code:</p>
  
  <pre><code>    $ db = new MysqliDb ('LocalHost', 'root', 'PASSWD', 'DB');
  $ wqdb = $ db-&gt; query ("SELECT * FROM db_table");
  foreach ($ wqdb as $ row) {
       $ con. = $ row ['ID'];
  }
  echo $ con;
  </code></pre>
  
  <p>Is there any way to solve it?</p>
  
  <hr>
  
  <p>/** Error Code **/</p>
  
  <pre><code> protected function _dynamicBindResults(mysqli_stmt $stmt)
          {
              $parameters = array();
              $results = array();
  
              $meta = $stmt-&gt;result_metadata();
  
              $row = array();
              while ($field = $meta-&gt;fetch_field()) {
                  $row[$field-&gt;name] = null;
                  $parameters[] = &amp; $row[$field-&gt;name];
              }
  
              call_user_func_array(array($stmt, 'bind_result'), $parameters);
  
              while ($stmt-&gt;fetch()) {
                  $x = array();
                  foreach ($row as $key =&gt; $val) {
                      $x[$key] = $val;
                  }
                  array_push($results, $x);
              }
              return $results;
          }
  </code></pre>