php-doc-en/reference/maxdb/functions/maxdb-autocommit.xml
Thomas Simenec ad2d322256 Update documentation
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@181642 c90b9560-bf6c-de11-be94-00142212c4b1
2005-03-08 16:39:06 +00:00

114 lines
2.8 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<refentry id="function.maxdb-autocommit">
<refnamediv>
<refname>maxdb_autocommit</refname>
<refname> maxdb->auto_commit</refname>
<refpurpose>Turns on or off auto-commiting database modifications</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<para>Procedural style:</para>
<methodsynopsis>
<type>bool</type><methodname>maxdb_autocommit</methodname>
<methodparam><type>resource</type><parameter>link</parameter></methodparam>
<methodparam><type>bool</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>Object oriented style (method)</para>
<classsynopsis>
<ooclass><classname>maxdb</classname></ooclass>
<methodsynopsis>
<type>bool</type>
<methodname>auto_commit</methodname>
<methodparam><type>bool</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<para>
<function>maxdb_autocommit</function> is used to turn on or off auto-commit mode
on queries for the database connection represented by the <parameter>link</parameter>
resource.
</para>
</refsect1>
<refsect1>
<title>Return values</title>
<para>
&return.success;
</para>
</refsect1>
<refsect1>
<title>See also</title>
<para>
<function>maxdb_commit</function>,
<function>maxdb_rollback</function>.
</para>
</refsect1>
<refsect1>
<title>Example</title>
<example>
<title>Object oriented style</title>
<programlisting role="php">
<![CDATA[
<?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();
?>
]]>
</programlisting>
</example>
<example>
<title>Procedural style</title>
<programlisting role="php">
<![CDATA[
<?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);
?>
]]>
</programlisting>
</example>
<para>
The above examples would produce no output.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->