When someone joins a group, i want the creator of the group to get an email. So I query the database for the group with that group name and get the email of the group creator.
sql = "SELECT `groupcreatoremail` FROM `userchurch_signup` WHERE `groupname` = '". $groupname . "' limit 1" ;
$result = $conn->query($sql);
$creator_email = "";
while ($fieldinfo=mysqli_fetch_field($result)) {
$creator_email = $fieldinfo->groupcreatoremail;
}
Based on testing I'm not getting anything even though if i run the SQL statement it works.