Welcome Guest, Not a member yet? Register   Sign In
dynamically store data in multidimensional arrays with keys
#4

[eluser]smickiedoo[/eluser]
Found the PHP function array_push(), which is used to append data to the end of an existing but I can't get it to work.

I tried:

Code:
$data['something'] = array();
foreach($query->result() as $row)
        {
          array_push(
                  
                $data['something'],  array('id'=>$row->id, 'name'=>$row->name, 'title'=$row->title )
            );
        }

It throws the same error as above...


Messages In This Thread
dynamically store data in multidimensional arrays with keys - by El Forum - 11-23-2008, 03:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB