|
Posted by Ivan Omelchenko 608308824 on 06/14/05 15:40
Kenneth Downs пишет:
> Domestos wrote:
>
>
>>Hi all,
>>
>>How do I check in a mySQL table called 'Users' on column user_name when
>>registering a new user_name to make sure the new 'user_name' does not
>>already exist in that column?
>>
>>TIA
>
>
> The database can do this by implementing a unique constraint on the column
> user_name. After issuing the INSERT, (or any SQL command), check for an
> error, and report it. This then solves your general problem of enforcing
> data integrity and reporting errors.
checking for the SQL error is not a good idea, actually.
Well known programing prupose to use select before insert.
Navigation:
[Reply to this message]
|