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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:37:52+00:00 2026-06-12T20:37:52+00:00

On other two tables, I have set foreign to d_desavanja->id field, but on this

  • 0

On other two tables, I have set foreign to d_desavanja->id field, but on this table, I can’t.

How can I make it works?

SQL query:

ALTER TABLE  `d_des_kat` ADD FOREIGN KEY (  `desavanje_id` ) REFERENCES  `desavanja`.`d_desavanja` (

`id`
) ON DELETE CASCADE ON UPDATE CASCADE ;

MySQL said: 

#1452 - Cannot add or update a child row: a foreign key constraint fails (`desavanja/#sql-12f3_5af2e`, CONSTRAINT `#sql-12f3_5af2e_ibfk_1` FOREIGN KEY (`desavanje_id`) REFERENCES `d_desavanja` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) 
  • 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-12T20:37:54+00:00Added an answer on June 12, 2026 at 8:37 pm

    You’ve got a row in d_des_kat that fails the constraint. Check your data to make sure that all non-NULL d_des_kat.desavanje_id values match an existing id in d_desavanja.

    The following query should show you the offending rows:

    SELECT *
    FROM d_des_kat
    WHERE desavanje_id NOT IN (SELECT id FROM d_desavanja)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables : one table it matchs and the other is teams.
Assume I have two tables: Table MY_ENTITY ID: PK OTHER_ID: FK to table OTHER
I have two tables. One table contains words. Other table contains points. table words:
I have two tables, one that has a foreign key from the other. I
I have a very simple database table that joins two other tables in a
I have two tables in the database: First Table: Students Field Type Null Key
I have two already-existing tables which look (in part) roughly like this: CREATE TABLE
I have two tables kinda like this: // Person.Details Table: PersonID int [PK] |
This is the situation: I have two tables where the one references the other
I have two tables one called fs_note the other called dumy_fs_note I created after

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.