Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 545179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:44:03+00:00 2026-05-13T10:44:03+00:00

When I am attempting to run "INSERT IGNORE …" in MYSQL to add only

  • 0

When I am attempting to run "INSERT IGNORE …" in MYSQL to add only one variable to a table of several options, after the first insert, it refuses to work. It says "Inserted rows: 0" and doesn’t insert my new value into the database. I believe this is because there is already an entry with a "nothing" value and MYSQL doesn’t allow the empty field to be duplicated. This seems to be odd behavior (as long as the two inserts are not exactly the same), so I am wondering if there is some way to avoid this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:44:03+00:00Added an answer on May 13, 2026 at 10:44 am

    The two INSERT do not have to be exactly the same, they just have to be the same for the primary key columns.

    INSERT IGNORE will ignore an insert if there is already a row with the same primary key.
    If you did INSERT instead of INSERT IGNORE, you would be getting an error (duplicate primary key).

    If you want to instead update the existing row, you can use REPLACE.

    Either way, there can be only one row for each primary key.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to run sudo pbuilder create however, when retrieving packages a different one
In attempting to run an external program in Powershell, the only way I have
I'm attempting to run multiple animations (slideshows of sorts) on one page, but the
Attempting to run this SQL: DELIMITER $$ CREATE TRIGGER crypt_f BEFORE INSERT ON c_data_test
I am attempting to run: INSERT INTO orders ('id','datetime','server','price','comment','addons','table_number','Omelet','Pancakes','Crepes','Salad','Steak_Sandwich','Chicken_Quesadilla','BLT','Prime_Rib','Pineapple_Upside_Down_Cake') VALUES ('','18/9/11 6:49:03PM','admin','0', 'N/A','None','0','1','2','3','4','5','6','7','8','9') and
When attempting to run the first example in the boost::mpi tutorial , I was
When attempting to run the following assembly program: .globl start start: pushq $0x0 movq
I am attempting to run the following command in KornShell (ksh): set -A INDEXES
I am attempting to run some unit tests in python from what I believe
I am attempting to run a parameterized query against a DB2 database from .NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.