(PECL maxdb >= 1.0)
maxdb_autocommit -- maxdb::auto_commit — Turns on or off auto-commiting database modifications
Stile procedurale
$link
, bool $mode
)Stile orientato agli oggetti
$mode
)
maxdb_autocommit() is used to turn on or off auto-commit mode
on queries for the database connection represented by the link
resource.
Restituisce TRUE
in caso di successo, FALSE
in caso di fallimento.
Example #1 Stile orientato agli oggetti
<?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 Stile procedurale
<?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($link, TRUE);
/* close connection */
maxdb_close($link);
?>
Il precedente esempio visualizzerĂ qualcosa simile a: