【发布时间】:2019-09-12 21:02:17
【问题描述】:
我想在 laravel 应用程序的 db 表中更新用户的最后一行数据。 我尝试使用 orderBy id desc limit 1 但它无法工作。
DB::table('shortcontacts')->where('mobile',($data->mobile))->update(['otp_stts'=>'Verified'])->orderBy('id','desc')->first();
【问题讨论】:
-
我正在尝试,它已更新所有行。我只想要最后一个。
标签: php mysql laravel sql-update