how can i update my data in a database using checkbox values?

Here in your code is wrong

for ($i=0; $i < count($questions) ; $i++) {
    $questions_update = Question::where('id', $questions[$i])->update([
      'scenario_id', $scenarios->id
    ]);
 }

must be

for ($i=0; $i < count($questions) ; $i++) {
    $questions_update = Question::where('id', $questions[$i])->update([
      'scenario_id'=> $scenarios->id
    ]);
 }

I think this must work

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top