Hi everyone,
First of all let me just tell you that I have never done database programming myself, and this is the first time I'm setting up a MySQL database via phpMyAdmin, so I could be missing something small but I'm sure someone will know the answer, anyways...
I have created and set up a MySQL database, and have created two tables ("Users" and "Payment Info"). I have added a unique ID field (along with other fields) in Users AND Payment Info. The Unique ID field in both tables are supposed to link both sets of records.
Both tables are set up using the InnoDB engine and I have tried to set up the Foreign Key but it wont work, here is the error message I'm getting:
"#1452 - Cannot add or update a child row: a foreign key constraint fails (`package5_PPS/Users`, CONSTRAINT `Users_ibfk_1` FOREIGN KEY (`Unique ID`) REFERENCES `Payment Info` (`Unique ID`) ON DELETE CASCADE ON UPDATE CASCADE)"
Please can you help, or please can you let me know if you need any more information before you can solve the problem.
This is for my full time job so please could you reply ASAP. All help is very much appreciated. Thanks.