title: why data not pass correctly codeigniter model
body: <p>I'm using codeigniter framework. In that model file i want to get count of answer , not answer.etc. my model like this.</p>
  
  <pre><code>     function daily_report() {
       $user = $this-&gt;session-&gt;userdata['id'];
        $date = $this-&gt;input-&gt;post('sdate');
  
        $sql="SELECT count(cl.`C_ansornot`) as bb, u.`E_name` 
            FROM `call` as cl
              inner join `user` as u on u.`idEmployee` = cl.`idEmployee`";
  
  
       $query = $this-&gt;db-&gt;query($sql);
      foreach ($query as $row){
         //  var_dump($query) ;
        $sql1="SELECT
                 count(`C_ansornot`) answer 
                 FROM `call` 
                 WHERE `C_ansornot`= 'answer' and idEmployee=$user and C_date= $date" ;
              $query2 = $this-&gt;db-&gt;select($sql1);
             // $answer=$this-&gt;$query2-&gt;result();
  
  
              $sql2 = "SELECT
                 count(`C_ansornot`) notAnswer
                 FROM `call` 
                 WHERE `C_ansornot`= 'not answer' and idEmployee=$user and C_date= $date";
  
          $query3 = $this-&gt;db-&gt;select($sql2);
        //  $notanswer =  $this-&gt;$query3-&gt;result() ;
  
        $sql3="SELECT
                 count(`C_ansornot`) Rejected 
                 FROM `call` 
                 WHERE `C_ansornot`= 'Rejected' idEmployee=$user and C_date= $date";  
                 $query4=$this-&gt;db-&gt;select($sql3);
               //   $rejected = $query4-&gt;result() ;
  
  
         $sql4="SELECT
                 count(`C_ansornot`) NotReachable 
                 FROM `call` 
                 WHERE `C_ansornot`= 'Not Reachable'idEmployee=$user and C_date= $date";
         $query5=$this-&gt;db-&gt;select($sql4);
                  // $NotReachable= $query5-&gt;result() ;
  
          $sql5="SELECT
                 count(`C_ansornot`) SwitchedOff
                 FROM `call` 
                 WHERE `C_ansornot`= 'Switched off' idEmployee=$user and C_date= $date";
                   $query6=$this-&gt;db-&gt;select($sql5);
                  //  $switched = $query6-&gt;result() ;
  
          $sql6="SELECT
                 count(`C_ansornot`) WrongNumber 
                 FROM `call` 
                 WHERE `C_ansornot`= 'Wrong Number/Invalid Number' idEmployee=$user and C_date= $date";
                  $query7=$this-&gt;db-&gt;select($sql6);
                  //  $WrongNumber = $query7-&gt;result() ;
  
           $return_array = array(
            //  'name'=&gt;$row-&gt;E_name,
              'answer'=&gt;$query2,
              'notAnswer'=&gt;$query3,
              'NotReachable'=&gt;$query4,
              'Rejected'=&gt;$query5,
              'SwitchedOff'=&gt;$query6,
              'WrongNumber'=&gt;$query7
  
          );
          var_dump($query2);
           return  $return_array;
  
           }
  
  
  } 
  </code></pre>
  
  <p>the model file not pass data correctly...
   when i check i result like this...
  <img src="https://i.stack.imgur.com/pgCPo.png" alt="enter image description here"></p>
  
  <p>the data display like this . </p>