I'm trying to display data in a table
through a foreach
in php
of more than 17 thousand records in the database, but it shows HTTP ERROR 500
in the browser.
<?php foreach($dados as $dado):?>
<tr>
... // aqui vai os registros
</tr>
<?php endforeach;?>
The interesting thing is that when I limit the amount of records to display, for example 5,000, the error does not occur.
Would this be a memory problem with php
?
Maybe I should not use foreach
?
Edit:
Apache log:
[Fri Sep 21 10:06:00 2018] [error] [client 192.168.0.100] PHP Fatal error:
Allowed memory size of 134217728 bytes exhausted (tried to allocate 27316224
bytes) in Unknown on line 0, referer:
http://192.168.0.100/index.php/relatorio/