Fw: data compare and duplicate entries..

2002-05-02 Thread Tech @NorthWeb

hi,
I was looking for an SQL statement or script that whould allow me to compare
data when it was entered into a mysql-php field on a web page so that it
checks whether the data entered has not been used before in the database..
In short, when data needs to be entered, the statement/script must check in
the database whether the data is not already entered into the database and
if its there, return with an error.. and not allow the data to be entered...
if the data is not there, then it may be entered..

Thanx
Willem Pretorius


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Fw: data compare and duplicate entries..

2002-05-02 Thread Dicky Wahyu Purnomo

On Thu, 2 May 2002 15:31:44 +0200
Tech @NorthWeb [EMAIL PROTECTED] wrote:

 hi,
 I was looking for an SQL statement or script that whould allow me to compare
 data when it was entered into a mysql-php field on a web page so that it
 checks whether the data entered has not been used before in the database..
 In short, when data needs to be entered, the statement/script must check in
 the database whether the data is not already entered into the database and
 if its there, return with an error.. and not allow the data to be entered...
 if the data is not there, then it may be entered..

You can also create primary key and index on the table, so if the record already 
exist, the mysql will return an error message (Duplicate entry on .. )

-- 
...Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and
the Ugly).
-- Matt Welsh

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php