#Selecting parents name to identify as volunteer. if ($parent eq "Father") { $sub_parent = "Mother"; $sth = $dbh->prepare ("select Father from Roster where User = \'$user\'"); $sth->execute (); $name = $sth->fetchrow_array; } #end if Father else { $sub_parent = "Father"; $sth = $dbh->prepare ("select Mother from Roster where User = \'$user\'"); $sth->execute (); $name = $sth->fetchrow_array; } #end else Mother if ($name eq ""){ $sth = $dbh->prepare ("select $sub_parent from Roster where User = \'$user\'"); $sth->execute (); $name = $sth->fetchrow_array; } #end chk for not parent if statement. print $query->h1({-align=>'center'},"THANK YOU FOR SIGNING UP $name"); foreach $date ( @volunteer_date ) { $sth = $dbh->prepare ("select distinct Volunteer from Volunteer where Volunteer = \'$name\' and Date = \'$date\'"); $sth->execute (); my $chk = $sth->fetchrow_array; if ($chk eq $name){ print $query->h1({-align=>'center'}, "You are already signed up for this date: $date"); } #end if statement else{ $sth = $dbh->prepare ("select max(Number) from Volunteer where Date = '$date' and Volunteer = 'TBD'"); $sth->execute ();