---------- Original Message ----------------------------------
From: Pete Kuczynski <[EMAIL PROTECTED]>
Date: Tue, 26 Jun 2001 13:19:02 -0500
>I want to prevent duplicate entries into my mysql database which holds
>invertory of all network eqpt at my site. Engineers access it thru
>netscape and the query insert is done via pdp [below].
>
>I will place the script into php, any pointers on this would be
>appreciated.
Why not make your inventory identifier field a unique index:
ie:
alter table inventory add unique itemid (itemid);
Now, whenever someone tries to create a duplicate item identifier,
MySQL will issue an error, which your script can capture. I don't use PHP, but do use
VB through MyODBC, and this is how I catch unwanted duplicates.
---------------------------------------------------------------------
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