title: retrieving data from DB oop
body: <p>I'm using the codeigniter framework, I'm retrieving data from the database in the form of an array but when i try to use the foreach function to display the data i get an error  </p>
  
  <pre><code> Message: Object of class stdClass could not be converted to string  
  </code></pre>
  
  <p>this is the array  </p>
  
  <pre><code>Array  
  (
  [0] =&gt; stdClass Object
      (
          [id] =&gt; 1
          [title] =&gt; title
          [data] =&gt; data
      )
  
  
  )
  </code></pre>
  
  <p>*The foreach is  </p>
  
  <pre><code>foreach($data as $r) echo $r  
  </code></pre>