thinkphp怎么去除重復值

thinkphp去除重復值的方法:1、打開相應的TP文件;2、通過“$result = M(“order”)->distinct(true)->select();”方法去除重復數據即可。

thinkphp怎么去除重復值

本文操作環境:Windows7系統、ThinkPHP5 版、Dell G3電腦。

thinkphp怎么去除重復值?

ThinkPHP去除重復數據 合并重復字段

1、去除重復數據

立即學習PHP免費學習筆記(深入)”;

distinct

$result?=?M("order")->distinct(true)->select();

2、合并重復字段

group

$result?=?M("user")->group("name")->select()

例如:name重復 只顯示一條

推薦學習:《最新的10個thinkphp視頻教程

以上就是

? 版權聲明
THE END
喜歡就支持一下吧
點贊13 分享