MySQL Forums
Forum List  »  Newbie

using Insert Ignore for a specific column only
Posted by: Rich Bernstein
Date: November 06, 2022 04:32PM

I am trying to insert a new row into an existing table using this:

INSERT IGNORE INTO employees (employee_id, employee, employee_email,campaign, email, w2_wages,taxyear) VALUES
(element('A', $dataArray[$row]),element('B', $dataArray[$row]),element('C', $dataArray[$row]),$_SESSION[campaign],$_SESSION[userid]
,element('D', $dataArray[$row]),element('D', $dataArray[$row]),element('E', $dataArray[$row])

I only want the IGNORE to ignore if the employee_email that I am inserting matches an existing employee_email. How do I let Mysql (7) know that it is only a matching employee_email that it needs ignore?

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.