背景:
thinkphp5.0的项目原部署环境是php5.6
更换服务器php版本为php7.2之后,报了上述错误。
原因:
each方法不在支持,支持foreach.
解决办法:
修改内置query查询文件的代码
文件路径:thinkphp/library/think/db/query.php
修改第704行的内容如下:
/*list($table, $alias) = each($join);*/
foreach ($join as $table => $alias) {
}