maxdb_autocommit

maxdb::auto_commit

(PECL maxdb >= 1.0)

maxdb_autocommit -- maxdb::auto_commitTurns on or off auto-commiting database modifications

說明

程序化風格

bool maxdb_autocommit ( resource $link , bool $mode )

物件導向風格

bool maxdb::auto_commit ( bool $mode )

maxdb_autocommit() is used to turn on or off auto-commit mode on queries for the database connection represented by the link resource.

回傳值

如果成功則回傳 TRUE,失敗則回傳 FALSE

範例

Example #1 物件導向風格

<?php
$maxdb 
= new maxdb("localhost""MONA""RED""DEMODB");

if (
maxdb_connect_errno()) {
   
printf("Connect failed: %s\n"maxdb_connect_error());
   exit();
}

/* turn autocommit on */
$maxdb->autocommit(TRUE);

/* close connection */
$maxdb->close();
?>

Example #2 程序化風格

<?php
$link 
maxdb_connect("localhost""MONA""RED""DEMODB");

if (!
$link) {
   
printf("Can't connect to localhost. Error: %s\n"maxdb_connect_error());
   exit();
}

/* turn autocommit on */
maxdb_autocommit($linkTRUE);

/* close connection */
maxdb_close($link);
?>

上例的輸出類似於:

參見

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top