Reply to Re: Members data base

Your name:

Reply:


Posted by Rik on 07/04/06 10:22

David wrote:
>>> I would like to have a members database for log ons into members
>>> areas.. How do you create and impliment such a database..
>>
>> Storing usernames and passwords
>> 1. Write table to contain member details.
>> 2. Write code to add details and ensure that username is unique
>
> 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 is
> only necessary to check the error number that is returned, if there
> was an error.

Or you can make it UNIQUE instead of primary, which would also work. I would
advise it in the database indeed. I wouldn't insert it in the database
before checking though. The point here is: it's easier to check before
trying to insert it and give a proper error-message to the client, instead
of blindly trying to insert something, get the error, provide code for the
different kinds of errors or use the very informative:'A problem has
occured'.....

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

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