所以我在更新表列时使用了这个 DB facade 和 eloquent
$affectedRows = DB::table('Users')
->where('Phone',$phonenumber)
->update(['IsActivated' => 'Y']);
或者这个:
$affectedRows = Users::where('Phone','=',$phonenumber)
->update(['IsActivated' => 'Y']);
但是我在访问url的时候遇到了这个错误
<span class="exception_message">SQLSTATE[42S22]: Column not found: 1054 Unknown column '0' in 'where clause' (SQL: select * from `users` where (`0` = Phone and `1` = = and `2` = 0000000000) limit 1)</span>
最佳答案
你可以尝试使用
$affectedRows = Users::where('Phone',$phonenumber)->update(['IsActivated' => 'Y']);
关于mysql - Laravel 5.4 - 无法更新 mysql 表列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43590912/