The following statement caught the program:
$result = mysqli_query($db, 'SELECT * FROM base');
And returned the following error:
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4194312 bytes) in C: \ xampp \ htdocs \ combina.php on line 57
The base
table was just under 3 million records , this table only has 3 fields int(10)
.
Ithinkmysqli_query
shouldnotloadthewholecontentsofthetableintomemory,right?
So,whythememoryoverflow?
Belowthecode:
$servername="localhost";
$username = "root";
$password = "";
$dbname = "comb";
$db = mysqli_connect($servername, $username, $password, $dbname);
if (!$db) {
die("Falha na conexão: " . mysqli_connect_error());
}
$result = mysqli_query($db, 'SELECT * FROM base');