SQLSTATE[HY000]: General error: 2014 错误如何处理
本地服务器,运行laravel项目,正常运行、生产服务器提示错误.
这里的sql代码是debug里面输出的
update `cy_product_type` set `parentid` = '3', `tree` = '0-1-3-551' where `id` = '551'
update cy_product_type set tree = CONCAT('0-1-3-551-',id) where tree like '0-1-550-551-%'
请问这个是什么错误?
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. (SQL: update cy_product_type set tree = CONCAT('0-1-3-551-',id) where tree like '0-1-550-551-%')
@LiamHao 没有并发,我只是在mode中updated事件执行更新代码。目前不知道如何调试,请指点下。
而且本地开发环境正常,生产环境报错。。
最后自己重写了一下代码,解决了。原因不清楚..
解决办法:把模型事件updated中的代码改为: