i don't understand why you're doing this --
$result = mysql_query("SELECT * FROM addresses");
$num_rows = mysql_num_rows($result);
$sql = mysql_query("SELECT * FROM addresses WHERE email='$email'");
$numRow = mysql_num_rows($sql);
you're returning the ~entire~ addresses table??
as for checking to see if it exists before inserting it, you don't really need to do that
just use INSERT with the ON DUPLICATE KEY UPDATE option if you want to capture the latest time for each email, or else use INSERT IGNORE to retain the first time for each email
Hi there, I'm returning the entire database table as my boss wants to receive a message each time someone subscribes that contains their email address and how many email addresses are on the database.
Thanks for your help, it's appreciated. Have I used the mysql_real_escape correctly?