hello;
thanks a lot for the reply. i was looking for a way to inject a transformation / function before the final result set is generated, but I believe the way you showed me would work fine.
the only think is I don’t know how to access the elements of the modified result set now. the standard method wouldn’t work I guess. see the message below.
a part of the model:
// get all user's data
function getAll()
{
$results=$this->db->get_where('users',array('id'=>$this->session->userdata('id')))->result_array();
foreach ($results as $row)
{
$row['email'] = $this->encrypt->decode($row['email']);
}
return $results;
}
the controller:
// a form used to edit user's data
function regFormEdit()
{
$data['results']=$this->users_model->getAll();
$this->load->view('users_edit_view',$data);
}
and the view:
<?php $row=$results->row();?>
Email: <input type="text" name="email" value="<?=$row->email?>"/>
All that gives me:
Fatal error: Call to a member function row() on a non-object in users_edit_view.php on line 9
Thanks again.