foreign key

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • poopsy
    New Member
    • Nov 2006
    • 50

    foreign key

    hi all,
    could anyone tell me how to put foreign keys in mysql..i mean i want to do it directly through phpMyAdmin and not by writing mysql scripts. i want to add foreign key for something like this:

    Alter table customer add foreign key(itemid) references itemid(items);

    but i dont want to write codes for this each time..
    i find only how to add primary key, unique and index
    on index it does not references they field in the other table
  • wizardry
    New Member
    • Jan 2009
    • 201

    #2
    hello -

    in phpmyadmin

    click the database you want then click on the child table

    then go to structure

    their by the print icon you should see a relational view.

    click on that and that is how you add the relationships.

    Comment

    Working...