diff --git a/schoolinvite.php b/schoolinvite.php
index d1a68e2..9c78836 100644
--- a/schoolinvite.php
+++ b/schoolinvite.php
@@ -99,7 +99,7 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
students,
registrations
WHERE
- schools_id='".$school->id."'
+ students.schools_id='".$school->id."'
AND students.year='".$config['FAIRYEAR']."'
AND students.registrations_id=registrations.id
ORDER BY
@@ -110,6 +110,7 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
{
echo i18n("In order for your school's students to register for the fair, you will need to invite them to register. Simply enter their email address below to invite them to register. Important: for group projects, only add one of the participants, that participant will then add the other group member(s) to the project");
echo "
";
+ echo "
";
$okaygrades=array();
if($school->projectlimitper=="total")
{
@@ -142,7 +143,7 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
students,
registrations
WHERE
- schools_id='".$school->id."'
+ students.schools_id='".$school->id."'
AND students.grade>='$catr->mingrade'
AND students.grade<='$catr->maxgrade'
AND students.year='".$config['FAIRYEAR']."'