i have tried to update data of my database, but there is no error this my method
public function update_pj_si(request $request)
{
$id = $request->id;
DB::table('tbl_profil_penyedia')
->where('id_profil_penyedia', $id)
->update(array('status' => 1));
return redirect('/verif/pj_si');
}
if i run this method, it run correctly and no error but the database is not updated. how can i fix this?
(request $request)should be(Request $request).. But you say you did not get an error.. that's strange. Is that a typo?wherecondition of the query didn't yield any results to update ... theupdatecall should return an integer of the number of records that were affectedprotected $fillable = ['status']dd(DB::table('tbl_profil_penyedia') ->where('id_profil_penyedia', $id) ->update(array('status' => 1));), if the return is 1, means updated success, if not, means updated failed. And if it is 0