diff --git a/register_participants_emergencycontact.php b/register_participants_emergencycontact.php index 9a63004..1b208ff 100644 --- a/register_participants_emergencycontact.php +++ b/register_participants_emergencycontact.php @@ -81,11 +81,13 @@ echo mysql_error(); else { //first, lets make sure this emergency contact really does belong to them foreach($_POST['ids'] AS $id) - { $q=mysql_query("SELECT * FROM emergencycontact WHERE id='$id' AND registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'"); + { + $q=mysql_query("SELECT * FROM emergencycontact WHERE id='$id' AND registrations_id='".$_SESSION['registration_id']."' AND year='".$config['FAIRYEAR']."'"); if(mysql_num_rows($q)==1) { - $e=stripslashes($_POST['email']); - if($_POST['relation']=="Parent" && $e && user_valid_email($e)) { - if($u=user_load_by_username($e)) { + $e=stripslashes($_POST['email'][$id]); + if($_POST['relation'][$id]=="Parent" && $e && user_valid_email($e)) { + echo "Updating parent record..."; + if($u=user_load_by_email($e)) { $u['firstname']=stripslashes($_POST['firstname'][$id]); $u['lastname']=stripslashes($_POST['lastname'][$id]); $u['phonehome']=stripslashes($_POST['phone1'][$id]);