Posted by Usenet on 07/04/06 16:38
> > I am using MySQL 5 with PHP 5. While running some test programs, I
> > noticed that it is not necessary to write any code which ensures that
> > a field is unique--if the field is defined as a primary key.
It's best not to use primary keys that have been picked by the user.
Presumably if the user has picked it, it's for a reason. It's quite possible
that the user will want to change it at some point. Pretty hard to do if it's
also being used by the system as a key...
Would they expect to be able to change it when it's their login id? P'raps
not. Still doesn't make it a good thing to do though :-)
Regards
Mark
[Back to original message]
|