![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mysql
无为践影行
phper
展开
-
laravel 打印sql语句
用到的函数:/** * 开启日志 */function openlogs(){ \Illuminate\Support\Facades\DB::connection()->enableQueryLog();}/** * 打印sql */function prsql(){ echo sql(\Illuminate\Support\Facades\DB::getQueryLog());}/** * sql 组合 */function sql($arr){原创 2021-05-18 17:03:12 · 1065 阅读 · 1 评论 -
php生成原生mysql批量更新语句
生成更新语句函数* 主要的 *function batchUpdate($data, $field, $table, $params = []) { if (!is_array($data) || !$field || !is_array($params)) { return false; } $updates = parseUpdate($data, $field); $where = parseParams($params); // 获取所有键原创 2021-01-05 17:17:46 · 296 阅读 · 0 评论