簡體   English   中英

Laravel 5.4更新了語法

[英]Laravel 5.4 updated syntax

嗨,大家有問題....

Call to undefined method Illuminate\Database\Query\Builder::udpate()

這是我的更新代碼......

DB::table('gpl_team')->where('id', $idteam)->udpate(['team_logo' => $logo, 'team_name' => $name, 'team_country' => $country, 'updated_at' => $updated_at]);

它的更新而不是udpate()拼寫錯誤

DB::table('gpl_team')->where('id', $idteam)->update(['team_logo' => $logo, 'team_name' => $name, 'team_country' => $country, 'updated_at' => $updated_at]);

嘗試這個我認為它應該是工作

  DB::table('gpl_team')->whereId($idteam)->update(['team_logo' => $logo, 'team_name' => $name, 'team_country' => $country, 'updated_at' => $updated_at]);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM