Hey, I was wondering how do I add foreign keys in php MyAdmin? I tried changing the storage type to innoDB, but the option is not available to me ? any ideas ?
phpMyAdmin lets you define foreign keys using their "relations" view. But since, MySQL only supports foreign constraints on "INNO DB" tables, the first step is to make sure the tables you are using are of that type.
To setup a foreign key so that the PID column in a table named CHILD references the ID column in a table named PARENT, you can do the following:
Take video of this:-
Edit:- You have option "operation" in your tab in php admin??
If yes then there you can see table opyions.There you can see storage engine???Change it to "InnoDB"
I tried changing the storage type to innoDB, but the option is not available to me
I've come across web-hosts that have this feature disabled.
Yea i saw this somewhere already but I cant chande my database to InnoDB? theres is only four options. CSV,MRG_MYISAM,memory and MYISAM...
take a look at this.
mysql> SHOW ENGINEs \g you can see what storage engines are there and what it supports.You can clearly see except innoDB no one supports foreign key.