Hi,

> This is my full code
> 
> $www_domain="select Failed_Signups.EmailAddress.Email from
> Failed_Signups.EmailAddress left join www_domain_net.Members on
> Failed_Signups.EmailAddress.Email=www_domain_net.Members.EmailAddress where
> www_domain_net.Members.EmailAddress is null";
> $www_domainRESULT=mysql_query($www_domain);
> $www_domain_rows=mysql_num_rows($www_domainRESULT);
> 
> for ($a=0; $a<$www_domain_rows; $a++)
> {
> mysql_data_seek($www_domainRESULT, $a);
> $www_domain_Array = mysql_fetch_array($www_domainRESULT);

The above two lines are at odds with each other. You are telling PHP to
advance the pointer in the result set with mysql_data_seek(), but
mysql_fetch_array() also does this automatically. So, in effect, you are
getting every alternate row from your result set here. Get rid of the
mysql_data_seek() line - it's not necessary.

> printf("%s", $www_domain_Array['Email']);
> $inlist .= sprintf("\'%s\'",$www_domain_Array['Email']);
> }
> 
> $query = mysql_db_query("Failed_Signups","DELETE FROM EmailAddress WHERE
> Email NOT IN (".$inlist.")");

I'm not surprised this doesn't work as expected. You are forming a list
($inlist) of e-mail addresses to put in the NOT IN expression, but you are
missing seperating them by commas. It needs to do this:

$inlist .= sprintf("\'%s\'", $www_domain_Array['Email']);
if($a < $www_domain_rows - 1) {
    $inlist .= ", ";
}

This will seperate all of them by commas (missing, of course, the last one).

Hope this gets you going. Also, if you have any more queries about your
code, you'd be better off asking on the PHP mailing list, as this problem
really isn't much to do with MySQL itself.

Regards,

------------------------------------------------
Basil Hussain ([EMAIL PROTECTED])


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to