Документация PHP
| Документация DHTML | Документация Smarty | SVG/VML Графика и JavaScript
| Документация bash |
maxdb_autocommit
maxdb->auto_commit
(No version information available, might be only in CVS)
maxdb->auto_commit — Turns on or off auto-commiting database modifications
Описание
Procedural style:
bool maxdb_autocommit ( resource $link , bool $mode )
Object oriented style (method)
maxdb
bool 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 в случае возникновения ошибки.
Примеры
Пример #1 Object oriented style
<?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();
?>
Пример #2 Procedural style
<?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);
?>
The above examples would produce no output.
Смотрите также