update : 2015.11.03
php.shukuma.com

검색:
 
 
Turns on or off auto-commiting database modifications

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);
?>

위 예제의 출력 예시:

참고