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.
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.
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 )