shage Posted July 2, 2007 Share Posted July 2, 2007 { case "delimit": foreach($addresses_delimit as $address) { $query = "SELECT * from ".MYSQL_TBL_MAILLIST_SUBSCRIBERS." WHERE address = '$address' && list_id='$_GET[list_id]'"; $result = mysql_query($query) or die("Query failed : " . mysql_error()); $num_rows = mysql_num_rows($result); if ($num_rows == 0 And validate_email($address) And !blacklist($address)) { $key = md5(time()); $req_time = time(); $insert_query = "INSERT INTO ".MYSQL_TBL_MAILLIST_SUBSCRIBERS." (list_id,address,userkey,confirmed,last_sub_req_date,bounce_count)VALUES ('$_GET[list_id]', '$address', '$key', '1', '$req_time', '0')"; $insert_result = mysql_query($insert_query) or die("Query failed : " . mysql_error()); $good_addresses[] = $address; } else { $bad_addresses[] = $address; } } How would i go about having it check another db also to see if $address is in there, if $address is not in there then add information to db what it is is unsubcribe db for my forum so i dont readd them on import, so i figured on unsubscribe will add their email into another table, if import sees email in unsubscribe table then dont add, if not then check to see if in db if not then add if already in there then dont add, i hope i said that right Quote Link to comment Share on other sites More sharing options...
trq Posted July 2, 2007 Share Posted July 2, 2007 How would i go about having it check another db also to see if $address is in there You will need to make a connection to the second db and query it. Quote Link to comment Share on other sites More sharing options...
shage Posted July 2, 2007 Author Share Posted July 2, 2007 itll be the same db just another table, so when they unsub itll transfer information to that table, im new at this stuff and trying to figure out the best way of doing this Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted July 2, 2007 Share Posted July 2, 2007 Im a little confused - dont you want to be deleting their email from the table rather than adding it to another? Quote Link to comment Share on other sites More sharing options...
shage Posted July 2, 2007 Author Share Posted July 2, 2007 well what would be the point of deleting it if import would add it again, im trying to make it so when i import that i dont add the same be that unsubcribed in the past, im trying to be good to my forum members Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.