enrol/db: Better warning when the user record is missing.

This commit is contained in:
martinlanghoff
2006-01-16 03:12:55 +00:00
parent 6ee745f7ec
commit 5f8ca5dfb6
+3 -2
View File
@@ -221,8 +221,9 @@ function sync_enrolments($type='student') {
trigger_error($db->ErrorMsg() .' STATEMENT: '. $sql);
return false;
}
if ( $ers->RecordCount() != 1 ) { // should not happen!
trigger_error('weird! no enrolment entry?');
if ( $ers->RecordCount() != 1 ) { // if this returns empty, it means we don't have the student record.
// should not happen -- but skip it anyway
trigger_error('weird! no user record entry?');
continue;
}
$userid = $ers->fields[0];