SQL Selekt nefunguje po upgrade PHP z 7.2 na 7.3
- MKI-Miro
- Člen | 278
Ahojte
Ked prehodim PHP verziu 7.2 na 7.3 tak mi zacne hlasit nasledovnu chybu
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':`category_type_rel`.`product_id` FROM `product` WHERE (`category_pieces_id` = 2 A' at line 1
SELECT *, `product`.`id`, `product`.`name` AS `name`, `product`.`name_en` AS `name_en`,
:`category_type_rel`.`product_id`
FROM `product`
WHERE (`category_pieces_id` = 2 AND `product`.`enabled` = 1 AND `product`.`price` != 0) AND
(`category_type_id` = '1')
ORDER BY `product`.`name` ASC
pricom select vyzera takto:
$this->productRepository->findAll()->select('*, product.id, product.name AS name, product.name_en AS name_en, :category_theme_rel.product_id')->where("category_theme_id = ? AND product.enabled = 1 AND product.price != 0", $id);
ako to opravim aby to slo aj na 7.3?
Dakujem
- MKI-Miro
- Člen | 278
tu dvojbodku tam neda
SELECT *, `product`.`id`, `product`.`name` AS `name`, `product`.`name_en` AS `name_en`,
`category_theme_rel`.`product_id`
FROM `product`
LEFT JOIN `category_theme_rel` ON `product`.`id` = `category_theme_rel`.`product_id`
WHERE (`category_theme_id` = 16 AND `product`.`enabled` = 1 AND `product`.`price` != 0)
ORDER BY `product`.`name` ASC