The first that springs to mind is:

pricture 2 tables. Pocket and Store.
(Where pocket as in "i have got money in my pocket", and store as in "Let's
go buy some shoes in the store!".

Pocket (
    money integer
) ;

Store (
    money integer
);

Now, suppose you are supposed to TRANSFER 10 dollars from Pocket to Store.
You buy some sheap shoes at some
arbitrary store.

SELECT money FROM Pocket...
UPDATE Store...
UPDATE Pocket...

Do this in a transaction! If something goes wrong updating Pocket, and only
the Store gets updated, you are one lucky bastard!! And we don't want that,
none of us!! ;)

Daniel Åkerud

> Paul,
>
> appreciate the feedback, but my question wasn't in reference to the actual
> coding and how it's used, this I understand, I was referring to when a
> transaction is best used, in what type of a scenario. ;)
>
> TIA




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

Reply via email to