You are here: Re: Using transactions in MySQL + PHP « PHP Programming Language « IT news, forums, messages
Re: Using transactions in MySQL + PHP

Posted by Joγo Morais on 08/02/07 13:03

> How to use COMMIT/ROLLBACK is more of a SQL question and belongs in
> comp.lang.mysql.

Sorry but I dont agree.. the question is not how to use commit/
rollback in a general way, but with PHP. If I only used MySQL i
wouldnt have this problem at all.

> I don't think it's a good idea to use die() - is that what you want your
> client to see?

I just used die as an example of abort/report failure, I wont use this
in my final script.

>Additionally, I'm not sure die() will roll back your transaction.

For what I understood, (and I may be wrong), the data will only be
saved if COMMIT is done. So if one of the first 3 queries fail, no
COMMIT will be done, then no data will be saved.

Same occurs if first 3 queries are made with success, and the last one
fails.


> There are other things you will need to consider with COMMIT and
> ROLLBACK.

What things?

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация