Re: Appending one MySQL file to another without duplicates.

Ferenc Kovacs <[email protected]>
Newsgroups gmane.comp.php.windows
Message-ID <[email protected]>
On Mon, May 10, 2010 at 8:03 AM, Niel Archer <[email protected]> wrote:

> Hi
>
> As this is not a PHP question and in particular not Windows' related
> PHP question, I'll keep my reply brief.
>
> If you had a unique index defined, duplicates wouldn't be allowed. Then
> you would only have to add IGNORE to the INSERT to prevent warnings
> being generated.
> http://dev.mysql.com/doc/refman/5.1/en/insert.html
>
>
I would suggest INSERT ... ON DUPLICATE UPDATE field = field instead of
IGNORE(because IGNORE can suppress other errors), but you are right about
that the unique constraint.

Tyrael
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.