当前位置:编程学习 > thinkphp >>

thinkphp5 框架 插入时主键冲突:insert ignore into

thinkphp5插入数据过滤重复:
需更改框架文件:thinkphp\library\think\db\Query.php

搜索:

public function insert

public function insertall

在sql下面添加

$sql = str_replace('INSERT INTO', 'INSERT IGNORE INTO', $sql);
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,