PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1848
Number of posts: 5016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
MYSQL Transaction support Posted by r_honey on 19 Jun 2007 at 9:34 AM
I could not find any PHP functions that allow me to send multiple queries to MySQL inside a single transaction. So, are there any such functions available around??

Moreover, are there any classes available in PHP that provide an OO interface to communicate with mysql via PHP???
Report
Re: MYSQL Transaction support Posted by quotient on 28 Jun 2007 at 7:02 AM
You can do that simply by using the correct SQL statements.
$sql = "START TRANSACTION;";
$sql .= "INSERT INTO `table` SET field=value;";
$sql .= "COMMIT;";

mysql_query($sql);
Just like you would do using a SQL client.

http://dev.mysql.com/books/mysqlpress/mysql-tutorial/ch10.html

Cheers.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.