Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.


    • CommentAuthorviane
    • CommentTimeNov 2nd 2006
     
    Hi guys,
    I am new in using phpMyAdmin software,
    I appreciate if you tell me how I can assign a Foreign Key to my tables?
    there is an icon for Primary Key, but not for Foreign Key. Also, I tried the SQL statement like ALTEL TABLE...
    but it does not work.

    Thank you.
    • CommentAuthorgilray
    • CommentTimeNov 2nd 2006
     
    Hi,

    It won't work bcaz by default mysql engine type is MyIsam.
    MyIsam don't support foreign key support. U hav to select engine type as InnoDB and then try.

    Hav a look at : http://dev.mysql.com/doc/refman/5.0/en/ans...reign-keys.html

    Thanks.
    • CommentAuthorjustnajm
    • CommentTimeNov 7th 2006
     
    Hi,

    My suggestion is that you should try to make conceptual foreign keys, keeping the primary key column name as foreign key column name in the table you want to create reference. Then peform quries by peforming some logical conditions such as:

    Select * From tbl-1,tbl-2 Where tbl-1.PK-col-name = tbl-2.FK-col-name (pk=primarykey , fk=foreignkey)

    Also I want to tell you something about MySQL, the features it does'nt support:

    1. Referential Integrity ( creating reference by making use of foreign keys )

    2. Transactions ( doing multiple records processing and if problem occur during any one process then doing rollback )

    3. Stored Procedures ( making use of calling one method or function to perform multiple task in one call )

    /cool.gif" style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" />