[eluser]andriu[/eluser]
Hi guys.
First of all I want to say thanks for quick response and help recieved on this forum!
Ok, Im a bit lost.
I have 3 tables.
Code:
proforma
proforma_products
proforma_products_discounts
I would like to get results and pass it all as one object.
To do this im trying:
Code:
$query = $this->db->get_where('proforma', array('id' => $id),1);
$row = $query->row();
$query = $this->db->get_where('proforma_products', array('proforma_id' => $id));
$row->products = $query->result();
// now i want a query that add the discounts(if there is any) for the relevant product to the object
// but i'm a bit lost.
$row->products->discount = $query->result();
I'm not that used with working with objects.
My solution would be doing a for() with php and add it to an multidimensional array.
Thanks for any help!