Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

n00b to mysql...

Options
  • 17-03-2012 11:31am
    #1
    Registered Users Posts: 3,735 ✭✭✭


    so i have a college project, need to create a website with a db !

    I have created the tables I feel I need, but I keep getting an error whilst try to create some dummy user table inserts ! key related I think ! but I cant fix it ...any ideas..

    Thanks
    Error

    SQL query: b_edit.png
    INSERT INTO `********`.`user` (
    `user_id` ,
    `username` ,
    `password` ,
    `email` ,
    `dob`
    )
    VALUES ( '1000000001', 'TestUser1', 'test1', 'test@test.ie', '1990-01-11'
    ) MySQL said: b_help.png
    #1452 - Cannot add or update a child row: a foreign key constraint fails (`*******/user`, CONSTRAINT `user_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`))
    http://i43.tinypic.com/33vemwo.png


Comments

  • Registered Users Posts: 11,979 ✭✭✭✭Giblet


    There is a constraint on another table that requires that user ids in one table be reflected into another. Find the table it is referring to, and insert the user into that first.


Advertisement