我正在尝试将新数据推送到现有数组中$query
:
$query = $this->db->get('questions');
foreach ($query->result_array() as $row) {
$get_answers = $this->db->get_where('answers', array('question_id' => $row['question_id']), 4);
}
//push all the get_answers data into $query array as a subarray
return $query;