title: PHP Error: Cannot use object of type stdClass as array (array and object issues)
body: <p>I was trying to copy this code:</p>
  
  <pre><code>&lt;?php
  foreach ($products as $product) {
      $id          = $product['id'];
      $name        = $product['name'];
      $description = $product['description'];
      $price       = $product['price'];
  ?&gt;
      &lt;tr&gt;
      &lt;td&gt;&lt;img src="&lt;?php echo $product['picture']; ?&gt;" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;b&gt;&lt;?php echo $name; ?&gt;&lt;/b&gt;&lt;br /&gt;
          &lt;?php echo $description; ?&gt;&lt;br /&gt;
            Price:&lt;big style="color:green"&gt;
            $&lt;?php echo $price; ?&gt;&lt;/big&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;?php
      echo form_open('cart/add');
      echo form_hidden('id', $id);
      echo form_hidden('name', $name);
      echo form_hidden('price', $price);
      echo form_submit('action', 'Add to Cart');
      echo form_close();
  ?&gt;
      &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;&lt;td colspan="2"&gt;&lt;hr size="1" /&gt;&lt;/td&gt;
  &lt;?php
  }
  ?&gt;
  </code></pre>
  
  <p>and here is my code:</p>
  
  <pre><code>&lt;?php
     foreach ($blogs as $blog) {
        $id      = $blog['id'];
        $title   = $blog['title'];
        $content = $blog['content'];
  ?&gt;
        &lt;h1&gt;&lt;?php echo $title; ?&gt;&lt;/h1&gt;
        &lt;h1&gt; &lt;?php echo $content; ?&gt; &lt;/h1&gt;
  
  &lt;?php
  }
  ?&gt;
  </code></pre>
  
  <p>I get this error every time I run my code: "Cannot use object of type stdClass as array"</p>