Page 1 of 1

prob in primary key

Posted: Wed Jan 05, 2011 2:22 am
by madu
hi friends,,,,
this is my table creation query,,,,
////
mysql_query("create table logg(fname varchar(20),lname varchar(20),pwd varchar(20),mnum varchar(20),hnum varchar(20),eid varchar(35),primary key(fname,eid))

////
i set fname and eid as primary key,,,, while i inserting already existing 'eid' it shows exception but when i am insert already existing 'fname' the executed suceddfully,,, i doesn't show exception,,, why

Re: prob in primary key

Posted: Wed Jan 05, 2011 2:37 am
by Darhazer
Exception is only if both fname and eid exists in the same record
example
fname | eid
abcde | 123
abcde | 234 - ok
bcdef | 123 - ok
abcde | 123 - exception