inner join to left join so if the cupboard is NULL then it still returns it and we can check if it's null
This commit is contained in:
parent
52e3f7cc66
commit
5104f917c2
@ -285,7 +285,7 @@ function get_users_products_array()
|
|||||||
cupboards.description AS cupboard_description, expiration_date,
|
cupboards.description AS cupboard_description, expiration_date,
|
||||||
added_date
|
added_date
|
||||||
FROM products
|
FROM products
|
||||||
INNER JOIN cupboards ON products.cupboard_id = cupboards.id
|
LEFT JOIN cupboards ON products.cupboard_id = cupboards.id
|
||||||
WHERE products.owner_id = :owner_id;";
|
WHERE products.owner_id = :owner_id;";
|
||||||
|
|
||||||
$query = $PDO->prepare($sql);
|
$query = $PDO->prepare($sql);
|
||||||
|
Loading…
Reference in New Issue
Block a user