I’ve created two simple tables in phpmyadmin. A list of “content creators” and a list of “content creator types”. Each “content creator” can have multiple “content creator types” associated with them so this is a one-many relationship. In phpmyadmin I created the following relationship.
ALTER TABLE `contentcreator`
ADD FOREIGN KEY ( `ContCreat_TypeID` )
REFERENCES `MyDatabase`.`contentcreator_types` (`ContCreat_TypeID`)
ON DELETE RESTRICT ON UPDATE RESTRICT ;
Now when I try to insert data (using the insert data interface in phpmyadmin) into the table “content creator” – I get a drop down to allow me to choose one of “content creator type IDs”. However I want to be able to add multiple “content creator type IDs” to each content creator. How do I do this within phpmyadmin using the insert data interface?
It sounds like you have a many to many relationship here, not a one to many. You need to add an intersection table with foreign keys to both your types table, and your content creators table.
If you wanted to do this as a one to many relationship, the side that is many gets the foreign key, not the side that is one. Meaning you would have a foreign key to the content Creators table on the content creators type table. Then each content creator would get a new entry in the type table for each type that it had, however you would have duplication in that scenario.
Many TO Many: