I am trying to set up a database using foreign keys as show below. Every time I try to insert data into anime_info using something along the lines of... Test Data: It gives me an error. What I would like to be able to do is to store what genres relate to what anime and be able to show that data on the selected anime page, and maybe one day be able to search animes by genre, but as of now I can't figure out what I did wrong. I expected when I inserted the data into anime_info it would cascade the newly create "anime_id: 1" into the other tables. Is this wrong? What's the best way to go about what I am trying to do. Error: [COLOR=#000000][FONT=monospace]#1452 - Cannot add or update a child row: a foreign key constraint fails (`cro91_redplanetanime`.`anime_info`, CONSTRAINT `anime_info_ibfk_1` FOREIGN KEY (`anime_id`) REFERENCES `anime_genre` (`anime_id`) ON DELETE CASCADE ON UPDATE CASCADE) [/FONT][/COLOR] Code (markup): You can't relate two databases together. IE apples and oranges cant both be linked to one another only apples to oranges or oranges to apples. You cant do apples to oranges and oranges to apples.
Not everybody crowed the reply button at one time. I figured the answer out. Gonna remove my table info from the main post.