I'm using a foreach to get the type of a question compared to the id of "T_Question" but there's always an unexpected error who say
Trying to get property of non-object
If i do that without a for(each) and take the first array there is no problem but I have to get all names of my table "T_Question_Type" compared to each ID of my table "T Question"
$output['questions'] = $this->question_model->get_all();
foreach($output['questions'] as $key => $object){
$id = $object->ID;
$t_question_type = $this->fk_question_type_model->get_by('ID = ' . $id);
$object->ID = $t_question_type->Type_Name;