From fe07722b5b421f3c16cfd9f01b5085ba808c2a0c Mon Sep 17 00:00:00 2001 From: james Date: Thu, 30 Oct 2008 16:39:06 +0000 Subject: [PATCH] Fix the namecheck code --- register_participants_namecheck.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/register_participants_namecheck.php b/register_participants_namecheck.php index 7bd00c4..482c5f7 100644 --- a/register_participants_namecheck.php +++ b/register_participants_namecheck.php @@ -41,12 +41,15 @@ $q=mysql_query("SELECT * FROM students WHERE registrations_id='{$_SESSION['registration_id']}'"); echo mysql_error(); - if(mysql_num_rows($q)==0) - { + if(mysql_num_rows($q)==0) { header("Location: register_participants.php"); exit; - } + + while($s=mysql_fetch_object($q)) { + $student_display_name[]="{$s->firstname} {$s->lastname}"; + } + //send the header send_header("Participant Registration - Check Your Name"); @@ -63,13 +66,9 @@ $pu = ($_POST['punc'] == 'yes') ? true : false; if($sp && $ca && $pu) { - if($s->namecheck_complete!='yes') { - $q=mysql_query("UPDATE students SET namecheck_complete='yes' WHERE registrations_id='{$_SESSION['registration_id']}'"); - $s->namecheck_complete = 'yes'; - } + $q=mysql_query("UPDATE students SET namecheck_complete='yes' WHERE registrations_id='{$_SESSION['registration_id']}'"); } else if($s->namecheck_complete!='no') { $q=mysql_query("UPDATE students SET namecheck_complete='no' WHERE registrations_id='{$_SESSION['registration_id']}'"); - $s->namecheck_complete = 'no'; } } }