Re: Adding Records & Capture The New Record ID

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

 



At 9:00 AM +1100 2/9/09, Chris wrote:
Person a signs up with email@xxxxxxxxxxx

Before you are able to fetch the result (which is possible in a high traffic site), person b also signs up with email@xxxxxxxxxxx

Going back to person a, when you fetch, you get record #2 instead of #1.

They are not the same record.

Not a great example because you probably wouldn't have people using the same address from different locations, but it's just to demonstrate the problem of doing it this way.

That's not true, or at least I don't believe it.

If I have a script that has opened and established a communication link with a dB and has just created a new record with an unique email address and the code immediately (next few lines in the script) follows that action with asking the dB to pull the record just created with that email address, then I AM getting the same record regardless -- there are no RACE conditions here.

Keep in mind that I AM using unique identifiers, such as a logon/password or email address. If I create a record using that unique identifier and then ask the dB to deliver it, then it is without doubt the same record.

If I was not using an unique identifier, then I would agree with you. But unique is unique -- it makes no difference if it's a record ID or email address -- both are unique.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
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