diff --git a/admin/reports_students.inc.php b/admin/reports_students.inc.php index d4be5d1..365544f 100644 --- a/admin/reports_students.inc.php +++ b/admin/reports_students.inc.php @@ -481,8 +481,8 @@ $report_students_fields = array( $emergencycontact_join = ''; if(in_array('emergencycontacts', $components)) { /* No need to put the year in here, students.id is unique across years */ - $emergencycontact_join = "LEFT JOIN emergencycontact ON ( - students.id=emergencycontact.students_id )"; + $emergencycontact_join = "LEFT JOIN emergencycontact ON + emergencycontact.students_id=students.id "; } $q = " FROM students @@ -491,7 +491,7 @@ $report_students_fields = array( LEFT JOIN projects ON projects.registrations_id=students.registrations_id LEFT JOIN projectdivisions ON projectdivisions.id=projects.projectdivisions_id LEFT JOIN projectcategories ON projectcategories.id=projects.projectcategories_id - LEFT JOIN emergencycontact ON emergencycontact.students_id=students.id + $emergencycontact_join $tour_join $partner_join WHERE