Welcome Guest, Not a member yet? Register   Sign In
How to fix function to return multi array ci 3
#2

You should init $ans array before the first (outer) foreach
PHP Code:
public function getexam_result($bode)
 
   {
 
       $ans=array();
 
       foreach($bode as $v)
 
       {
 
         $this->db->where('question_id',$v);
 
         $q=$this->db->get('answer_true');
 
         $rs=$q->result();
 
         //...
        
}
        return 
$ans;
    } 
Reply


Messages In This Thread
RE: How to fix function to return multi array ci 3 - by pdthinh - 01-21-2017, 05:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB