Hello,
My problem is
I try to do a simple JOIN between two tables, that both have the id field. My result is an stdClass object, as I use PDO. Does anyone know how can I make a difference between the id of the first table and the id of the second table?
Code
bc. $sql = "SELECT *, FROM products AS p, products_categories as c WHERE c.id = p.category";
$stmt = $__CONN__->prepare($sql);
$stmt->execute();
$products = array();
while($product = $stmt->fetchObject())
$products[] = $product;
return $products;
If I try to use $products->id, it will show me the id of the category table. If it was an array, I could use $products['p.id'] , I need an alternative to this.
Thanks a lot.