From 5104f917c23825eb88cdbcb4f0cae3d5392e8f0d Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Mon, 11 Nov 2019 14:53:08 +0100 Subject: [PATCH] inner join to left join so if the cupboard is NULL then it still returns it and we can check if it's null --- assets/php/utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/php/utils.php b/assets/php/utils.php index 19c8ce6..ab2af50 100644 --- a/assets/php/utils.php +++ b/assets/php/utils.php @@ -285,7 +285,7 @@ function get_users_products_array() cupboards.description AS cupboard_description, expiration_date, added_date 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;"; $query = $PDO->prepare($sql);