My project uses the open source PHP library https://github.com/ajillion/PHP-MySQLi-Database-Class
But the project in the middle of the year reports: "Fatal error: the allowed memory size of 134217728 bytes has been exhausted (tried to allocate 4294967296 bytes) in / home 1 / flipalbu / public_html / kvisofttest / login-admin / Lib / class.MysqliDb.php on line 422" This mistake,
My server: linux x86_64
PHP Version 5.4.17
Mysql Version: 5.5.32
memory_limit = 128M
Line 422: call_user_func_array (array ($ stmt, 'bind_result'), $ parameters);
Request a piece of code:
$ db = new MysqliDb ('LocalHost', 'root', 'PASSWD', 'DB'); $ wqdb = $ db-> query ("SELECT * FROM db_table"); foreach ($ wqdb as $ row) { $ con. = $ row ['ID']; } echo $ con;
Is there any way to solve it?
/** Error code **/
protected function _dynamicBindResults(mysqli_stmt $stmt) { $parameters = array(); $results = array(); $meta = $stmt->result_metadata(); $row = array(); while ($field = $meta->fetch_field()) { $row[$field->name] = null; $parameters[] = & $row[$field->name]; } call_user_func_array(array($stmt, 'bind_result'), $parameters); while ($stmt->fetch()) { $x = array(); foreach ($row as $key => $val) { $x[$key] = $val; } array_push($results, $x); } return $results; }
php mysql
user2637147
source share