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 6678555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:15:26+00:00 2026-05-26T04:15:26+00:00

I read a few solutions on stack overflow and found this to be the

  • 0

I read a few solutions on stack overflow and found this to be the closest to my question:

MySQL "good" way to insert a row if not found, or update it if it is found

Basically, I’m creating an index of words (from websites) and one of my tables is just a primary key (integer id), and a varchar(35) word.

I need to be able to try and insert a new entry (basically, a new word) word into this table. If the word is not present, a new record with it will be added. If it is present, nothing will happen.

What’s the best way to get this functionality? “REPLACE INTO” changes my keys which is not desirable – I’d just like it to be a no-op if mysql finds the word is already in the database table.

  • 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-26T04:15:27+00:00Added an answer on May 26, 2026 at 4:15 am

    Assuming you have a unique key on the word – using insert ignore might do the trick.

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

Sidebar

Related Questions

i've just read a few posts on hiding Silverlight code in some way. Main
I've read a few solutions on here, but my problem differs enough where those
I've seen a few solutions to this, but the solution every time seems to
I know there are quite a few solutions for this problem but mine was
looking to implement google closure with msbuild. i found a few solutions but struggling
Few months ago i read this Swing tutorial http://zetcode.com/tutorials/javaswingtutorial/resizablecomponent/ for understanding how implementing resizable
Apologies for the long post -- Read a few threads about this, but still
I've read a few instances in reading mathematics and computer science that use the
I need to read smallish (few MB at the most, UTF-8 encoded) XML files,
I've read a few posts where people have stated (not suggested, not discussed, not

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.