I am trying to figure out how to display a product with the sizes that it has. Now it is displayed with duplication.
'Maat' being sizes and 'Voorraad' being stock
Here is my query:
$sql = "SELECT * FROM producten JOIN product_specificaties";
I am trying to figure out how to display a product with the sizes that it has. Now it is displayed with duplication.
'Maat' being sizes and 'Voorraad' being stock
Here is my query:
$sql = "SELECT * FROM producten JOIN product_specificaties";
Try this
$sql = "
SELECT *
FROM producten p
JOIN product_specificaties s
ON p.id = s.product_id
";
Returns general information, you can use select or other items, say if you have something specific
SELECT * FROM producten INNER JOIN product_specificaties ON
producten.id=product_specificaties.product_id;