title: PHP Error Undefined property: stdClass::$barang in CodeIgniter 2
body: <p>Hi I encounterd this error :</p>
  
  <pre><code>A PHP Error was encountered
  
  Severity: Notice
  
  Message: Undefined property: stdClass::$barang
  
  Filename: views/dashboard_admin.php
  
  Line Number: 112
  </code></pre>
  
  <p>I will show you my code first then I'll tell you my thought. :)</p>
  
  <p>model : </p>
  
  <pre><code>function get_data_table(){
          $query_result = $this-&gt;db-&gt;query('SELECT "barang.kode_item", nama_item, nama_ruang, jml_item_kondisi, kondisi 
              FROM barang 
              INNER JOIN info_barang ON barang.kode_item = info_barang.kode_item 
              INNER JOIN (
                  SELECT ruang.nama_ruang, campur_table.kode_item 
                  FROM ruang 
                  INNER JOIN rekap_isi_ruang AS campur_table ON campur_table.nomor_ruang = ruang.nomor_ruang) AS barang_campur 
              ON barang.kode_item = barang_campur.kode_item');
          return $query_result;
      }
  </code></pre>
  
  <p>view :</p>
  
  <pre><code>&lt;?php foreach($result as $data_barang):?&gt;
         &lt;tr&gt;
             &lt;td&gt;&lt;?php echo $data_barang-&gt;barang.kode_item;?&gt;&lt;/td&gt;
             &lt;td&gt;&lt;?php echo $data_barang-&gt;nama_item;?&gt;&lt;/td&gt;
             &lt;td&gt;&lt;?php echo $data_barang-&gt;nama_ruang;?&gt;&lt;/td&gt;
             &lt;td&gt;&lt;?php echo $data_barang-&gt;jml_item_kondisi;?&gt;&lt;/td&gt;
             &lt;td&gt;&lt;?php echo $data_barang-&gt;kondisi;?&gt;&lt;/td&gt;
         &lt;/tr&gt;
  &lt;?php endforeach;?&gt;
  </code></pre>
  
  <p>In view, I just figured out that <code>barang.kode_item</code> be read as barang(concat)kode_item.. The variable cannot contains '<code>.</code>' but I don't know how to resolve this because my query must use that '<code>.</code>' to resolve the ambiguous error in mysql. Is there any way to manipulate it ?</p>
  
  <p>By the way, i'm sorry if there's any words that doesn't look familiar to you. Thanks</p>