Page 1 of 1

Why is this causing my server to run out of memory?

Posted: Fri Sep 24, 2004 11:22 am
by stsr11
The following code should not have any effect at all, but it causes my PHP server to run out of allocated RAM. If you echo the output to a screen it appears to be adding new $data[] array elements until it crashes. Am I doing something completely stupid or is this a bug?

Code: Select all

$res = mysql_query("select * from table limit 0,10");
while ($data = mysql_fetch_array($res)) 
&#123; for ($i=0;$i<count($data);$i++) &#123; $data&#1111;$i] = $data&#1111;$i]; &#125; &#125;

Posted: Fri Sep 24, 2004 11:29 am
by stsr11
Ignore this I found the answer!!!