since the emails are all on one row, deleting an email is slightly more tricky then just deleting the row, so i made this code to get the emails in the database (which does include the , if there is one) and then it checks the string to see if the email that has been entered for removal is somewhere in the middle or at the end of the string by looking for the ' ,' that is added to the end of string before the email therefor the last email doesnt have the , and there is a comma inbetween the emails, when the check is done the email is replaced with nothing ie: "" and then it updates the db...
ok heres the code:
$exist = mysql_query("SELECT email FROM $tablename");
$exist = mysql_fetch_array($exist);
$existingemail = $exist['email'];
$checkio = strpos($existingemail,$_POST['email'].' ,');
if($checkio === false) {
$newemail = str_replace($_POST['email'],"",$existingemail);}
elseif ($checkio === true) {
$newemail = str_replace($_POST['email'].' ,',"",$existingemail);}
$update = mysql_query("UPDATE $tablename SET email='$newemail' ");
one thing ive just thought of now, is that if the email being entered is the first email, it adds a space and comma before it, which will make an error when the mail() runs.. .will fix up some code to get rid of that error