I am writing a simple script to collect email addresses.
I want to collect ALL email addresses, even if they are duplicated.
However, I don't want to add the emaill address each time. I want to identify that the email address is already registered and then have another field [number] that will give the total number of times that the email address has been registered.
e.g The first time an email address is registered, it will put 1 into [number].
The second time the email address is registered it will put 2 into [number]
The third time the email address is registered it will put 3 into [number]
etc...
Up to now I have got:
PHP Code:
if($email != '') {
$qry = "SELECT * FROM bf_users WHERE email='$email'";
$result = mysql_query($qry);
if($result) {
if(mysql_num_rows($result) > 0) {
This will check if the email address already exists in the database, but I am now stuck.
Any help and advise will be very welcome.
Thanks,