return result of recursively executed query using codeigniter -
i new codegniter. have used following code execute function recursively. in first call pass reply_id in function have used query select id having parent_id = reply_id in foreach same process selected ids. now want return combine array recursion.because each id query executed , new result each time. how can that?? $resultq3 = $this->showreply($reply_id); //first call function <?php public function showreply( $reply_id ) { $q1 =$this->db->select('*') ->from('forum_reply fr') ->where('fr.parent_id',$reply_id) ->order_by('fr.id ')->get();; foreach( $q1->result_array() $row4 ) { $id = $row4['id']; $parent_id = $row4['parent_id']; if( $parent_id !=0 ) { $this->showreply( $id ); } } return $result; //here want return result } ?> edited code: $result...