i get the following error- Notice: Undefined variable: emails in d:..\ on line 49
$ret_email= "SELECT emailAddress FROM mailinglists WHERE seminarID= '$id'";
$email_result= mysql_query($ret_email, $dbc) or die (mysql_error());
// retrieves the date from a particular seminar number.
while ($row=mysql_fetch_array($email_result)) {
$emails = $row['emailAddress'];
}
// where the mailinglist is created then an email can be send
line: 49
if($emails !="") {
//can view the template
{ else {
echo '<h1>need to create mailing list</h1>';
}
what i am trying to do is to be able to check if the user has created a mailing list if they haven't then a message appears saying that the user needs to create one. This code works where there are email addresses created however where there are no email address created then the message does appear that the user needs to create a mailing list however it also comes with the following error
Notice: Undefined variable: emails in d:..\ on line 49
i know that the email addresses in the emails variable are empty but how do i resolve this error
thanks