im trying to make foreign key relation between whishlist_tbl(foreign) table and account_tbl(primary key) table
both are integer data container


i have user deatail table that is account_tbl and whish list table i.e wishlist_tbl i want that when user make a wish book then he must be registerd one and he must have account id i.e ac_id in the account_tbl where any or every wish item user add in the wishlist_tbl table must have his ac_id link with account_tbl, but when i tried to make relationship between both table this error occurs

SQL message

Cannot add or update a child row: a foreign key constraint fails (birds_eye.<result 2 when explaining filename '#sql-1204_1'>, CONSTRAINT FK_wishlist_tbl FOREIGN KEY (ac_id) REFERENCES account_tbl (ac_id))

***can anyone guide me what m i doing wrong because i've no idea as i ve made other relation like the same in this data base too and they are fine btw this a cart database any sugestion would be appericiated do reply thank all

5 Years
Discussion Span
Last Post by aabi

i uses GUI that is SQLYOQ but the qurey pop up with error msg is:

alter tablebirds_eye.wishlist_tbladd constraintFK_wishlist_tbl_acFOREIGN KEY (ac_id) REFERENCESaccount(ac_id)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.