Re: Re: customer ids

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Davey ha scritto:
Hi Burn,

Wednesday, June 6, 2007, 4:39:05 PM, you wrote:

Worst thing that can happen is having mysql throw an error while trying
to insert an ID that's already present in the database. It gets more complicated and unpredictable if the field isn't required to be unique
at database design level.

Wanting to make it perfectly safe the check should include the INSERT statement and continue looping till it's successful as well.

Or just wrap the whole thing in a stored procedure / transaction (it's
what they were invented for after-all :), tasks like this should be
pushed to SQL as much as possible imho.

Cheers,

Rich

True, true :)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux