Posted by Jerry Stuckle on 05/24/07 04:22
Phil Latio wrote:
> "Ravi" <Ravindrayepuri@gmail.com> wrote in message
> news:1179927719.748113.179470@m36g2000hse.googlegroups.com...
>> use Mysql_error() function to get the error value or mysql_errorno()
>> function to get the error no
>
> This thing that confuses me is that it has 2 unique fields. Can these
> functions identify which field has thrown the error?
>
> Cheers
>
> Phil
>
>
Phil,
Proper database normalization means you will not have two unique fields
defining the same row.
With that said - there are a lot of reasons why you might have that
(i.e. userid and email address must be unique).
If it does fail, then do your SELECT and see which one caused the error.
If you get nothing back, then the row was deleted between the time you
tried the insert and ran the select - so you should be able to retry it.
Just limit the number of retries so you don't get into a race
condition between two scripts.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|