hello i have some data in mysql table which consist of email address, now i have a file which contains all the email which i want to exclude frm the mysql database which is stored, can anyone tell me how do i do it???
Here's an example code (untested) First, load your e-mail from your database $email_db = array(); $q = mysql_query("SELECT email FROM user") or die(mysql_error()); while ($r = mysql_fetch_array($q)) $email_db[] = $r[0]; // The world is bright PHP: Now load your e-mail list from your file (put this on the same file as above) // The world is bright $f = trim(file_get_contents('yourfile-here.txt')); $f = str_replace("\r", '', $f); $email_file = explode("\n", $f)// Its stored here // Big river PHP: Now lets filter the name // Big river $filtered_email = array(); foreach ($email_db as $e) { // if picked email from database is not in our file list if (!in_array($e, $email_file)) { $filtered_email[] = $e;// push the e-mail } } // The sky is blue PHP: Now if you want to echo all of those filtered e-mails : // The sky is blue echo(implode('<br />', $filtered_email)); PHP: