Hi,
If anyone can help me it would me much apprecciated. I am trying to add a section to an email subscription page which will check to see whether the email address already exists in the database and display an appropriate message. I have tried various different methods but I don't seem to be able to generate a list of the email addresses (although I can print it using a while loop). When I use the following code ($Email is from the form input) it will only match on the last row of the email table instead of searching through all the email address's
$Duplicate= mysql_query( "SELECT * FROM email" );
$myArray = mysql_fetch_array($Duplicate);
if (preg_match("/$Email/i", "/$myArray/")) {print "$Email is already subscribed. Please close this window"; }else {$Query="INSERT into $table values ('0','$FirstName','$LastName','$Email','1')";
print("<br><The query is:<br>$Query\n");
}
I know the answer is obvious if you know how but I don't and would much apprecciate guidance.
Thanks in Advance
π