title: Trying to get property of non-object - CodeIgniter
body: <p>I'm trying to make update form, that is going to retrieve the data for the specific ID selected, and fill in the form, so its going to be available for updating.</p>
  
  <p>When I click edit on the specific entry (Product in my case), it takes me to the <code>edit_product_view</code>, but states the error <strong>"Trying to get property of non-object"</strong> for every variable that I use in <code>set_values</code> of the form elements.</p>
  
  <p>Using <code>print_r</code>, I get the correct associative array, so it's passed correctly.</p>
  
  <p>This is excerpt of my <code>edit_product_view</code>.</p>
  
  <pre><code>&lt;h2&gt;&lt;?php echo $heading; ?&gt;&lt;/h2&gt;
  &lt;hr&gt;
  &lt;table id="newproduct"&gt;
  &lt;?php echo form_open('products/edit/'.$product-&gt;id); ?&gt;
  &lt;tr&gt;
      &lt;td class="label"&gt;&lt;?php echo form_label('Name:');?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo form_input('prodname', set_value('prodname', $product-&gt;prodname));?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td class="label"&gt;&lt;?php echo form_label('Product Type:');?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo form_dropdown('ptname_fk', $product_types, set_value('ptname_fk', $product-&gt;ptname_fk));?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p><code>$product</code> is the array holding all the key-value pairs, but I cannot fill the form for some reason.</p>
  
  <p>Thank you in advance!</p>