Erg - indeed, a fix for something I overlooked

This commit is contained in:
jacob 2011-03-02 23:00:14 +00:00
parent 0c6f1c3b70
commit b955b01965
2 changed files with 4 additions and 5 deletions

View File

@ -22,9 +22,9 @@
*/ */
?> ?>
<? <?
require("common.inc.php"); require_once("common.inc.php");
include "register_participants.inc.php"; require_once("register_participants.inc.php");
include "projects.inc.php"; require_once("projects.inc.php");
$q = mysql_query("SELECT registrations.status AS status, registrations.id AS regid, users.id AS studentid, users.firstname FROM registrations, users " . $q = mysql_query("SELECT registrations.status AS status, registrations.id AS regid, users.id AS studentid, users.firstname FROM registrations, users " .
"WHERE users.id = {$_SESSION['users_id']} AND users.registrations_id = registrations.id"); "WHERE users.id = {$_SESSION['users_id']} AND users.registrations_id = registrations.id");

View File

@ -868,13 +868,12 @@ function user_save(&$u)
} }
if(mysql_error() != '') return "SQLERR7: " . mysql_error(); if(mysql_error() != '') return "SQLERR7: " . mysql_error();
} }
if($u['orig']['grade'] != $u['grade'] && $u['registrations_id']){ if($u['orig']['grade'] != $u['grade'] && $u['registrations_id']){
// their grade has changed and they're connected to a registration. Let's update // their grade has changed and they're connected to a registration. Let's update
// the registration's grade level to match if necessary // the registration's grade level to match if necessary
$category = getProjectCategory($u['registrations_id']); $category = getProjectCategory($u['registrations_id']);
if($category !== null){ if($category !== null){
mysql_query("UPDATE projects SET projectcategories_id = $category WHERE registrations_id = $registration_id"); mysql_query("UPDATE projects SET projectcategories_id = $category WHERE registrations_id = {$u['registrations_id']}");
if(mysql_error() != '') return "SQLERR8: " . mysql_error(); if(mysql_error() != '') return "SQLERR8: " . mysql_error();
} }