SELECT shop_products.productName, shop_products.product_id, shop_products_reviews.*, shop_order_items.order_id, shop_order_items.option_id, shop_product_options.product_id AS pid FROM shop_orders LEFT JOIN shop_order_items ON shop_order_items.order_id = shop_orders.order_id LEFT JOIN shop_product_options ON shop_order_items.option_id = shop_product_options.option_id LEFT JOIN shop_products_reviews ON shop_products_reviews.intProductId = shop_product_options.product_id AND shop_products_reviews.intCustomerId = LEFT JOIN shop_products ON shop_product_options.product_id = shop_products.product_id WHERE shop_orders.customer_id = AND shop_orders.isCancelled = 0 AND shop_orders.isPaid = 1 AND shop_orders.isDeleted = 0 AND shop_products.isDeleted = 0 AND shop_products.isLive = 1 ORDER BY shop_products_reviews.intReviewId IS NULL DESC, shop_products_reviews.intReviewId DESC, shop_orders.dateCreated DESC, shop_products_reviews.dateCreated DESC
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'JOIN shop_products ON shop_product_options.product_id = shop_products.product_id' at line 6