Multiple Joins with Where's

Posted 1 month ago by jhutto

I have a query that I can't get to work. It works if I take out the second join with instructors

$SemesterCourse = DB::table('coursesemester')
            ->join('somascourses', '', '=', 'somascourses.SemesterID')
            ->join('instructors', 'somascourses.SemesterID', '=', '')
                ['', $semesterid],
                ['', $courseid],])

This mysql statement is working on the database

SELECT * FROM coursesemester
INNER JOIN somascourses ON = somascourses.SemesterID
INNER JOIN instructors ON somascourses.Instructorid =
WHERE = 31 AND = 345

So, it seems to the the double Join that kills the query

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.