I have two tables with following costruction:
errortype:
| id | errortype_text |
errorreason:
| id | errorreason_text | errortype_id |
I would like to select all data from errorreason table and replace the errortype_id data with the coresponding errortype_text.
if the tables have a foreign key you can do that in your model:
$this->db->select('erroreason_text');
$this->db->join('errorreason', 'errortype.id = errorreason.id');
$query = $this->db->get('errortype');
return $query->result();