Results 1 to 2 of 2
  1. #1
    Join Date
    May 2012

    Unanswered: Database error, unable to solve the problem


    We're currently having a project at school, in which we are going to create a website that contains a possibility for enrollment. The website is going to be a site that offers courses, so I want it to be possible to fill a form with forename, surname, phone number, course and difficulty.

    I use MySQL Workbench, and the creation of the database went just fine. I connected it to Dreamweaver, where I established the website. I also created two recordsets that contain course name and difficulty respectively. I've also made the form with what I want it to contain. Course and difficulty are drop down menus.

    When I'm going to test the database out and see if it works as intended by filling out the form on the website, I get the following error:
    Cannot add or update a child row: a foreign key constraint fails (`ekma3107`.`attendant`, CONSTRAINT `fk_attendant_course` FOREIGN KEY (`idcourse`) REFERENCES `course` (`idcourse`) ON DELETE NO ACTION ON UPDATE NO ACTION)
    I just haven't been able to find out what's causing this error. I've been trying to solve it for so long, that I'm on the verge of pulling my own hair out. It might by the way be worth mentioning the fact that a local server is up and running, so the problem doesn't lie there.

    I was told another place that I needed to change 'ON UPDATE' from 'NO ACTION' to 'CASCADE', which resulted in the same error, just with 'ON UPDATE CASCADE' on the end of the message instead.

    Let me know if more information is required. Help is very much appreciated. Thank you.

  2. #2
    Join Date
    May 2012
    Never mind, managed to make it work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts