I want to run the below code but it shows the error:
SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'name' in where clause is ambiguous
Code:
$query = $obj->modelsManager->createBuilder() ->columns([ 'id' => 'Exams.id', 'name' => 'Exams.name', 'time' => 'Exams.time', 'course' => 'Courses.name', 'description' => 'Courses.description', 'information' => 'Courses.information', 'courseCode' => 'Courses.code', 'logo' => 'Vendors.logo', 'vendor' => 'Vendors.name' ]) ->from('Exams') ->join('Courses', 'Exams.course_id = Courses.id') ->join('Vendors', 'Exams.vendor_id = Vendors.id') ->where('Vendors.active = :vactive: AND Courses.active = :cactive: AND Exams.active = :eactive: AND Vendors.name = :vendor: AND Courses.name like :course: AND Exams.name like :exam:', ['vactive' => 1, 'cactive' => 1, 'eactive' => 1, 'vendor' => 'aaa', 'course' => 'bbb', 'exam' => 'ccc']);
$query->getQuery()->execute();
As far I understand I am using table aliases for every name column in where clause. And also use active column in same way but it doesn't have any issue/error.