Hello i am kinda new to this list, and to mysql... I am trying to link 2 tables, but there seems to be an catch i havent for seen... i made this table first like this:
create table kunder(KundeID int NOT NULL PRIMARY KEY auto_increment, Fornavn varchar(25) NOT NULL, Etternavn varchar(25) NOT NULL, Poststed char(25) NOT NULL, postnummer int NOT NULL); then i made the second table like this: create table tlfnr (TeleID int NOT NULL PRIMARY KEY auto_increment, KundeID int NOT NULL REFERENCES kunder(KundeID), Type char(10) NOT NULL, Nummer int NOT NULL); Shouldnt this be enough to encoforce refirental integrity ? Still i can both insert records that dosent have an kundeID in table kuder and i can delete an kundeID that has an TeleID, i hopefully avoid this problem since both the kundeID and TeleID is releated --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php