gpt4 book ai didi

mysql - Prestashop - 在 adminController 中使用 $this->_select 时出现错误

转载 作者:行者123 更新时间:2023-11-29 06:17:12 26 4
gpt4 key购买 nike

当我扩展 adminController 并定义要在 $this->_select 变量中显示的属性时,Prestashop 显示此错误:

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 ' a.store_name, a.id_product FROM ps_selstock_product a ' at line 3

      SELECT SQL_CALC_FOUND_ROWS
,
a.store_name,
a.id_product FROM `ps_selstock_product` a


WHERE 1

ORDER BY a.`id_selstock_product` ASC LIMIT 0,50

我的 $this->_select 变量包含:

$this->_select = '
a.store_name,
a.id_product';

我知道查询应该是这样的,删除',':

SELECT SQL_CALC_FOUND_ROWS

a.store_name,
a.id_product FROM `ps_selstock_product` a


WHERE 1

ORDER BY a.`id_selstock_product` ASC LIMIT 0,50

但我不知道如何处理,因为查询是由 prestashop 构建的,我只定义了要显示的属性

最佳答案

你试过吗?

$this->_select = 'a.store_name,a.id_product';

关于mysql - Prestashop - 在 adminController 中使用 $this->_select 时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35201100/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com