>From the returned results create a comma delimited list containing unique
identifiers of the returned results and then in your SQL statement, have

        DELETE FROM ... WHERE ... NOT IN (comma delimited)

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 30, 2001 9:02
Subject: Delete?


> Hi,
>
> I`m just trying to figure out the best method to delete my records and
> wondered if it was possible to do a DELETE statement to remove any records
> that don`t match.
>
> Here is my code so far
>
> $Query="select blah its huge:-)";
> $RESULT=mysql_query($Query);
> $my_rows=mysql_num_rows($RESULT);
>
> for ($a=0; $a<$my_rows; $a++)
>     {
>     mysql_data_seek($RESULT, $a);
>     $Array = mysql_fetch_array($RESULT);
>     printf("%s", $Array['Email']);
>     }
>
> My Query returns Matched Records, what I would like to achieve is deletion
of
> the records that didn`t match, would it be possible to do that under the
> printf statement. So delete all the records in the table that don`t match
up
> to $Array['Email']  ??
>
> Thanks for any input
> Ade
>
> ---------------------------------------------------------------------
> 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


---------------------------------------------------------------------
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