Hi. I want to apply foreign key constraint to one of the column in the table. How can I apply it using PHPMyAdmin? I am unable to get the option of applying foreign key constraint. Please help me. Thanks in advance.
I know this is an old thread but to update it for the search engines: If you have all the pre-requirements setup for foreign keys (innodb tables, indexes, etc.) Click on the table you want Click on the structures tab Below the fields you should see a relation view Then you should see the fields to create the foreign keys constraints Best Mark
I posted some video tutorials on how to use phpMyAdmin to create foreign key restraints on my blog: w w w.mytechmusings.com/2008/04/using-foreign-keys-in-mysql.html As a new user to this forum I'm not yet permitted to post URLs. Remove the spaces between the 3 w's in the URI above and add the appropriate http scheme to the beginning of the address.
hi guys ... i want to convert this mysql code to phpmyadmin i can create tables and set unique and primary field but i can't understand how to set bold lines in phpmyadmin .... thank you ... this is my code in MYSQL ... [FONT=Tahoma]create table DISCOUNT( DISCOUNT_ID SMALLINT not null , STORE_ID CHAR( 12 ) not null , DISC_PERSENT SMALLINT not null , DISC_TYPE VARCHAR2( 20 ) , [B] constraint CKC_DISC_TYPE_DISCOUNT check ( DISC_TYPE is null or ( DISC_TYPE in ('High','Medium','Low')))[/B] DISC_LOWQTY NUMBER , Disc_HIGHQTY NUMBER , constraint PK_DISCOUNT primary key (DISCOUNT_ID) ); [B] create index STORE_DISC_FK on DISCOUNT ( STORE_ID ASC ); alter table DISCOUNT add constraint FK_DISCOUNT_STORE_DIS_STORE foreign key (STORE_ID) reference STORE(STOR_ID); [/B][/FONT] Code (markup): and this is my code in PHPMyadmin [FONT=Tahoma]CREATE TABLE `bookshop`.`Discount` ( `Discount_ID` SMALLINT NOT NULL , `Store_ID` CHAR( 12 ) NOT NULL , `Disc_Persent` SMALLINT NOT NULL , `Disc_Type` VARCHAR( 20 ) NOT NULL , `Disc_LowQTY` INT , `Disc_HighQTY` INT NOT NULL , PRIMARY KEY ( `Store_ID` ) , UNIQUE ( `Discount_ID` ) ) ENGINE = InnoDB[/FONT] Code (markup):