Reply to Re: Members data base

Your name:

Reply:


Posted by Rik on 07/04/06 18:50

Usenet wrote:
>>> 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 :-)

Exactly.
I'd us a normal integer autoincrement as primary key, perhaps a UNIQUE index
on username, but I'll always check with PHP. Just makes reporting the errors
back to the user easier.

Grtz,
--
Rik Wasmus

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация