<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.odbc-autocommit" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>odbc_autocommit</refname>
  <refpurpose>Toggle autocommit behaviour</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type class="union"><type>int</type><type>bool</type></type><methodname>odbc_autocommit</methodname>
   <methodparam><type>resource</type><parameter>odbc</parameter></methodparam>
   <methodparam choice="opt"><type>bool</type><parameter>enable</parameter><initializer>&null;</initializer></methodparam>
  </methodsynopsis>
  <para>
   Toggles autocommit behaviour.
  </para>
  <para>
   By default, auto-commit is on for a connection.  Disabling
   auto-commit is equivalent with starting a transaction.
  </para>
 </refsect1>
 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>odbc</parameter></term>
     <listitem>
      &odbc.connection.id;
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>enable</parameter></term>
     <listitem>
      <para>
       If <parameter>enable</parameter> is &true;, auto-commit is enabled, if
       it is &false; auto-commit is disabled.
       If &null; is passed, this function returns the auto-commit status for
       <parameter>odbc</parameter>.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>
 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Without the <parameter>enable</parameter> parameter, this function returns
   auto-commit status for <parameter>odbc</parameter>. Non-zero is
   returned if auto-commit is on, 0 if it is off, or &false; if an error
   occurs.
  </para>
  <para>
   If <parameter>enable</parameter> is set, this function returns &true; on
   success and &false; on failure.
  </para>
 </refsect1>

 <refsect1 role="changelog">
  &reftitle.changelog;
  <informaltable>
   <tgroup cols="2">
    <thead>
     <row>
      <entry>&Version;</entry>
      <entry>&Description;</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry>8.3.0</entry>
      <entry>
       <parameter>enable</parameter> is now nullable.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </informaltable>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>odbc_commit</function></member>
    <member><function>odbc_rollback</function></member>
   </simplelist>
  </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:"~/.phpdoc/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
-->
