Copyright © ashik rahman's Blog

Wednesday, July 22, 2015

when you are going to crate relations with your's database tables plz keep in your mind:



  • The two tables must have the same engine i.e. ENGINE=InnoDB. (can be others: ENGINE=MyISAM works too)
  • The two tables must have the same charset.
  • The PK column(s) in the parent table and the FK column(s) must be the same data type. (if the PRIMARY Key in the Parent table is UNSIGNED, be sure to select UNSIGNED in the Child Table field)
  • The PK column(s) in the parent table and the FK column(s), if they have a define collation type, must have the same collation type;
  • If there is data already in the foreign key table, the FK column value(s) must match values in the parent table PK columns.
  • And the child table cannot be a temporary table.
  •