where( id , 1) &nbs..."/>
您好,登錄后才能下訂單哦!
說明
update 方法返回影響數(shù)據(jù)的條數(shù),沒修改任何數(shù)據(jù)返回 0
示例1
Db::table('think_user') ->where('id', 1) ->update(['name' => 'thinkphp']);
輸出
1
數(shù)據(jù)中包含主鍵形式
示例2
Db::table('think_user') ->update(['name' => 'thinkphp','id'=>1]);
輸出
1
使用SQL
函數(shù)或者其它字段進行更新
Db::table('think_user') ->where('id', 1) ->update([ 'login_time' => ['exp','now()'], 'login_times' => ['exp','login_times+1'], ]);
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內(nèi)容。