Welcome Guest, Not a member yet? Register   Sign In
multiple table issue
#5

[eluser]Clooner[/eluser]
Code:
$query = $this->db->query('SELECT carts.*, products.* FROM carts, products WHERE carts.product_id = products.id');

This is how you get the data, am I right? You select carts.* and products.* and both have an id? try changing the select statement to
Code:
SELECT carts.*, products.*, carts.id AS cart_id, products.id AS product_id
and then use cart_id instead of the id!


Messages In This Thread
multiple table issue - by El Forum - 07-24-2012, 12:13 PM
multiple table issue - by El Forum - 07-24-2012, 01:08 PM
multiple table issue - by El Forum - 07-24-2012, 01:29 PM
multiple table issue - by El Forum - 07-24-2012, 01:30 PM
multiple table issue - by El Forum - 07-24-2012, 01:45 PM
multiple table issue - by El Forum - 07-24-2012, 01:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB