[eluser]Charles Garrison[/eluser]
I have a function that pulls data from a database using the active record method - the code looks something like this...
Code:
$selected_db = $this->load->database( $this->confg, TRUE );
$selected_db->select( '*' );
$selected_db->from( 'table_name' );
$selected_db->where( 'zip', '87111' );
$query = $selected_db->get();
When I put this into a foreach loop, I am able to access the data like this...
Code:
foreach( $query->result() as $row ) {
echo $row->name; //assuming name was one of the database fields
}
My problem is I want to modify some of this returned data AND keep it in the same format as it was so I can access it using the foreach loop / $row->... statement as detailed above. Everytime I do this, I lose the structure and end up with an array. Anyone know how to do this?