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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:39:34+00:00 2026-06-12T01:39:34+00:00

Possible Duplicate: Error appears in sql when trying to add multiple foreign keys I

  • 0

Possible Duplicate:
Error appears in sql when trying to add multiple foreign keys

I am trying to alter a table so That I can add a foreign key constraint in mysql database:

ALTER TABLE  `Question` ADD CONSTRAINT `FK_question` FOREIGN KEY (`QuestionId`)
REFERENCES `Image_Question` (`QuestionId`) ON DELETE CASCADE ;

Problem is that it is giving me this error:

1452 – Cannot add or update a child row: a foreign key constraint fails (mobile_app.

‘#sql-4517_15241’>, CONSTRAINT FK_question FOREIGN KEY
(QuestionId) REFERENCES Image_Question (QuestionId) ON DELETE
CASCADE)

What does this error actually mean and what are the possible solutions I might have to undertake in order to fix 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-06-12T01:39:35+00:00Added an answer on June 12, 2026 at 1:39 am

    Probably Image_Question.QuestionId is not unique. And it also looks like the FK should go the other way around, from Image_Question to Question

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

Sidebar

Related Questions

Possible Duplicate: Parse error on explode('-','foo-bar')[0] (for instance) In PHP there are functions that
Possible Duplicate: Uploadify: show error message from HTTP response I am trying to get
Possible Duplicate: error installing coffeescript on mac 10.7.2 At the moment, I am trying
Possible Duplicate: raise error within MySql function In MsSQL I can raise a custom
Possible Duplicate: Best practices in error reporting (Mathematica) Assume that I have a function
Possible Duplicate: Factory Girl sequences not incrementing It appears that FactoryGirl is not performing
Possible Duplicate: error using CArray Duplicate : error using CArray so, i am trying
Possible Duplicate: error: Unable to find vcvarsall.bat I'm trying to install MySql interface for
Possible Duplicate: Facebook Connect error: can't post to wall in iPhone I had a
Possible Duplicate: Why do I get a emulator-5554 disconnected message this error appears sometimes

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.