News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Thilanka Kaushalya's Blog:
How to use Mysql Transactions with PHP
March 20, 2012 @ 13:04:37

In this recent post to his blog Thilanka Kaushalya shows how to use transactions in MySQL databases (using mysqli

Web applications are more popular today than ever with the increasing number of internet users. Most of the standard alone applications converted as web based applications or at least they try to provide a web interface for users. PHP and Mysql are two leading technologies which allow uses on rapid development of web based systems. "Transaction" is a powerful concept which comes with Mysql 4.0 and above versions. Lets explore that.

He introduces the concept of transactions first, providing an example of a bank transfer between two individuals. He uses this to create a simple code sample that turns off the autocommit for the connection (using mysqli_autocommit set to false) and running the SQL in order before the commit. He also includes an example of using the rollback function to return the data back to its original state if there's an error.

0 comments voice your opinion now!
mysql transactions mysqli tutorial rollback


blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: Memberships with Laravel Cashier

DevShed: Creating Image Streams from Existing Graphics with the GD Library in PHP

Hiveminds: How to Bridge PHP and Java for Powerful Web Solutions

DevShed: Generating View from MySQL to Simulate the Model-View-Controller Schema in PHP

Gergely Hodicska's Blog: What's new in PHP 5.3 - part 1: namespaces


Community Events

Don't see your event here?
Let us know!


series application community opinion release configure symfony2 interview api conference framework performance introduction library language example install podcast laravel php7

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework