2

This is a bit of a newb question, so apologies if the answer is really obvious. I have a bunch of InnoDB MySQL tables set up with Foreign Key restraints. This is all fine, as far as I can tell, however I'd like to use it to insert data into the database.

I was hoping I would be able to use a dropdown menu, since I should, in theory, be unable to enter any data into the Parent table that the Child table doesn't already have.

Unfortunately this is all I see when I'm in the Parent table:

enter image description here

There is nothing to allow me to choose data from the child tables.

How do I use this feature? And is it possible to see the contents of a different column (e.g. When picking "EventID" being able to see "EventName" from the same table?).

I'm kind of hoping that I'm not just going to have to write a .php page to do the same thing.

Thanks a lot.


Update: When exported the FK declarations look like this (i.e. fine, as far as I can tell):

ALTER TABLE `Nominations`
  ADD CONSTRAINT `Nominations_ibfk_1` FOREIGN KEY (`FilmID`) REFERENCES `Films` (`FilmID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `Nominations_ibfk_2` FOREIGN KEY (`AwardID`) REFERENCES `Awards` (`AwardID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `Nominations_ibfk_4` FOREIGN KEY (`EventID`) REFERENCES `Events` (`EventID`) ON DELETE CASCADE ON UPDATE CASCADE;
Chuck Le Butt
  • 47,570
  • 62
  • 203
  • 289
  • I'd guess that you have problem on database level, this should work, please triple check your structure (export table and check sql). – Vyktor Feb 02 '12 at 22:01
  • I've exported and looked through it. I can't seem to find any issues? What can I check? – Chuck Le Butt Feb 02 '12 at 22:05
  • Correct `FOREIGN KEY`s definitions. – Vyktor Feb 02 '12 at 22:06
  • Everything was setup through the interface, so it's all "correct" (i.e. no spelling mistakes). There's data in each of the tables in question, too. I've set everything to "CASCADE", so maybe that's the problem? Or maybe I shouldn't have set up the relationships on the Parent table? – Chuck Le Butt Feb 02 '12 at 22:13

0 Answers0