title: Notice: Trying to get property of non-object
body: <p>i am facing this problem here. i want to show item's name by getting its item id from another table. following is the code<br>
  i am having problem when i try to show name using ".$obj[0]->name." in the first line of the for loop. </p>
  
  <pre><code>$objClass = array(); 
  $objClass1 = array();
  $obj= array(); 
  $object = new product();
  $objLogic = new customerLogic();
  $objLogic1 = new customerLogic(); 
  $objL= new productLogic();
  $objClass[0]= new stdClass;
  $objClass1[0]= new stdClass;
  $obj[0]= new stdClass;
  $objClass[0]-&gt;custId = $_GET['id'];
  $objClass1[0]-&gt;custId = $_GET['id'];
  
  $objClass = $objLogic-&gt;getSaleRecord_customer($objClass[0]);
  $objClass1 = $objLogic1-&gt;getName_customer($objClass1[0]);
  $object-&gt;itemId = $objClass[0]-&gt;itemId;
  $obj =$objL-&gt;getName_product($object-&gt;itemId); 
  // echo $objClass1[0]-&gt;firstName;
  $i=1;
  foreach($objClass as $customer ) {
      echo "&lt;tr&gt;&lt;td class=\"inner_text\"&gt;$customer-&gt;reciept&lt;/td&gt;&lt;td align=\"center\"&gt;".$obj[0]-&gt;name."&lt;/td&gt;";
      echo "&lt;td align=\"center\"&gt;".$objClass1[0]-&gt;firstName."&amp;nbsp;".$objClass1[0]-&gt;lastName."&lt;/td&gt;&lt;td align=\"center\"&gt;";
      echo "$customer-&gt;weight&lt;/td&gt;
      &lt;td align=\"center\"&gt;$customer-&gt;costPerKg&lt;/td&gt;
      &lt;td align=\"center\"&gt;$customer-&gt;cost&lt;/td&gt;
      &lt;td align=\"center\"&gt;$customer-&gt;payed&lt;/td&gt;
      &lt;td align=\"center\"&gt;$customer-&gt;remaining&lt;/td&gt;&lt;/tr&gt;";
      $i++;
  }
  ?&gt;
  &lt;/table&gt;
  </code></pre>