tgavin Posted February 2, 2007 Share Posted February 2, 2007 I'm having some problem with unsetting invalid email addresses. I've commented out anything that's not related and have narrowed it down to (I think!) the unset() and continue lines. // begin building the INSERT query for the subscribers_temp table //$query = "INSERT INTO {$database}.subscribers_temp(email) VALUES "; //$insert_count = 0; foreach($emails as $email) { // check if address is "valid" if(check_email_address($email)) { // address is valid $email = $email; } else { // address is not valid $bad_error = 1; $bad_email[] = $email; $bad_count = count($bad_email); unset($email); continue; } // check for duplicate email addresses //$email_check = email_check($email); /*if($email_check > 0) { // email address already exists! $dup_error = 1; $dup_email[] = $email; $dup_count = count($dup_email); }*/ $query = $query . " ('$email'),"; //$insert_count++; //$new_email = $email; } // finish building the query $insert_query = rtrim($query,','); var_dump($insert_query);exit; If I enter an invalid email address (@test.com) and var_dump() the query, I'm returned string(60) "INSERT INTO subscribers_temp(email) VALUES " which produces an mysql error. I'm not sure how to fix this. I'm getting all googly-eyed! Link to comment https://forums.phpfreaks.com/topic/36815-solved-unset-problem/ Share on other sites More sharing options...
tgavin Posted February 3, 2007 Author Share Posted February 3, 2007 Got it straightened out. Link to comment https://forums.phpfreaks.com/topic/36815-solved-unset-problem/#findComment-175879 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.