diff --git a/admin/judges_info.php b/admin/judges_info.php
index d738deb..0d51a77 100644
--- a/admin/judges_info.php
+++ b/admin/judges_info.php
@@ -88,7 +88,7 @@ $preferencechoices=array(
echo "
\n";
echo " ".i18n("Age category preference")." | ";
-$q=mysql_query("SELECT judges_catpref.*,projectcategories.category FROM judges_catpref,projectcategories WHERE judges_id='{$_GET['id']}' AND judges_catpref.year='".$config['FAIRYEAR']."' AND judges_catpref.projectcategories_id=projectcategories.id");
+$q=mysql_query("SELECT judges_catpref.*,projectcategories.category FROM judges_catpref,projectcategories WHERE judges_id='{$_GET['id']}' AND judges_catpref.year='".$config['FAIRYEAR']."' AND projectcategories.year='".$config['FAIRYEAR']."' AND judges_catpref.projectcategories_id=projectcategories.id");
echo mysql_error();
while($r=mysql_fetch_object($q))
echo i18n($r->category).": ".$preferencechoices[$r->rank]." ";
@@ -158,7 +158,7 @@ while($r=mysql_fetch_object($q))
echo "";
//grab the list of divisions, because the last fields of the table will be the sub-divisions
- $q=mysql_query("SELECT * FROM projectdivisions ORDER BY id AND year='".$config['FAIRYEAR']."'");
+ $q=mysql_query("SELECT * FROM projectdivisions WHERE year='".$config['FAIRYEAR']."' ORDER BY id");
$divs=array();
while($r=mysql_fetch_object($q))
{
@@ -166,9 +166,15 @@ while($r=mysql_fetch_object($q))
$divnames[$r->id]=$r->division;
}
- $subdivq=mysql_query("SELECT judges_expertise.*, projectsubdivisions.subdivision, projectsubdivisions.projectdivisions_id AS parent_id FROM judges_expertise
+ $subdivq=mysql_query("SELECT judges_expertise.*,
+ projectsubdivisions.subdivision,
+ projectsubdivisions.projectdivisions_id AS parent_id
+ FROM judges_expertise
LEFT JOIN projectsubdivisions ON judges_expertise.projectsubdivisions_id=projectsubdivisions.id
- WHERE judges_id='$judgeinfo->id' AND judges_expertise.year='".$config['FAIRYEAR']."' ORDER BY projectdivisions_id, projectsubdivisions_id");
+ WHERE judges_id='$judgeinfo->id'
+ AND judges_expertise.year='".$config['FAIRYEAR']."'
+ ORDER BY projectdivisions_id, projectsubdivisions_id");
+ echo mysql_error();
$judge_divs=array();
$judge_subdivs=array();
$divdata=array();
|