Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [PHP-DB] multiple queries, one transaction - REWORDED
Crate an Array, where the Key is the ItemId, and the value is the ItemQty.
If the client want to delete an the item, unset the key, if the client
wont to add or remove an item quantity, just change the value.

Then when the items and quantities are correct, just=20
<start transaction>
<begin foreach>
If (! (INSERT ..... (order, ItemID (the array key), ItemQty (the array
value of the key))...))
<rollback transaction>
<break>
<end foreach>
<commit transaction>

So if the insert is failed, you rollbackit.
No need for a DELETE

--=20
Atte, Andr=E9s G. Monta=F1ez
T=E9cnico en Redes y Telecomunicaciones
Montevideo - Uruguay

Report this thread to moderator Post Follow-up to this message
Old Post
Andrés G. Montañez
05-27-05 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP DB archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:30 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.