• support@answerspoint.com

how to print an array of objects in codeigniter- php?

3152

I am facing a problem to fetch array in codeigniter

$data['one']=$this->db->query($sql1);
$data['tho']=$this->db->query($sql2);
$data['three']=$this->db->query($sql3);

I am trying to do this following code I am getting error

Fatal error: Call to a member function result() on a non-object in

If I do var_dump($data['one']); I am getting the following displayed:

Array
(
 [0] => stdClass Object
 (
  [date] => 2013-09-28
 )
 [1] => stdClass Object
 (
  [date] => 1970-01-01
 )
 [2] => stdClass Object
 (
  [date] => 2013-09-28
 ) 
)

0Answer


Your Answer

    Facebook Share