downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

PDO::__construct> <PDO::beginTransaction
[edit] Last updated: Fri, 10 Feb 2012

view this page in

PDO::commit

(PHP 5 >= 5.1.0, PECL pdo >= 0.1.0)

PDO::commit トランザクションをコミットする

説明

bool PDO::commit ( void )

トランザクションをコミットし、 次に PDO::beginTransaction() で新たなトランザクションが開始されるまで、 データベース接続をオートコミットモードに戻します。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

例1 トランザクションをコミットする

<?php
/* トランザクションを開始する。オートコミットがオフになる */
$dbh->beginTransaction();

/* データベーススキーマを変更する */
$sth $dbh->exec("DROP TABLE fruit");

/* 変更をコミットする */
$dbh->commit();

/* データベース接続はオートコミットモードに戻る */
?>

参考



add a note add a note User Contributed Notes PDO::commit
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites