Welcome Guest, Not a member yet? Register   Sign In
problem when using a while loop
#4

[eluser]Spleshmen[/eluser]
i just want to learn how to use it with the while statement to, not just the foreach.
let me put it this way :
why this code its working
Code:
foreach($query->result() as $row) {
        $data[] = $row;
}
and this one is not
Code:
while($row = $query->result()) {
      $data[] = $row;
}
//if i use this code i get a error sayng :  
//Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 35 bytes) in ...


Messages In This Thread
problem when using a while loop - by El Forum - 12-26-2009, 09:03 AM
problem when using a while loop - by El Forum - 12-26-2009, 09:36 AM
problem when using a while loop - by El Forum - 12-26-2009, 09:36 AM
problem when using a while loop - by El Forum - 12-26-2009, 09:52 AM
problem when using a while loop - by El Forum - 12-26-2009, 10:22 AM
problem when using a while loop - by El Forum - 12-26-2009, 10:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB