Home » Php » How to create condition between 3 related tables

How to create condition between 3 related tables

Posted by: admin September 25, 2018 Leave a comment

Questions:

Beginer with sql,
I’m working on laravel and want to change the values of a table that the user who is connected is linked
I have 3 tables:
User(id) foreign key in Exams(user_id)
and
Exams(id) foreign key in Verification(exam_id)
How to change the verifications of only the user connected ?
he doing it by himself so
I think we wil need

 Auth::user()
    DB::table('verifications')->where([
    ['confirmation', 'non'],
    ['modifier', 'oui'],
    ])->update(['confirmation' => "oui"]);
Answers: