<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.uodbc.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.odbc-autocommit.php',
    1 => 'odbc_autocommit',
    2 => 'Toggle autocommit behaviour',
  ),
  'up' => 
  array (
    0 => 'ref.uodbc.php',
    1 => 'ODBC Functions',
  ),
  'prev' => 
  array (
    0 => 'ref.uodbc.php',
    1 => 'ODBC Functions',
  ),
  'next' => 
  array (
    0 => 'function.odbc-binmode.php',
    1 => 'odbc_binmode',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/uodbc/functions/odbc-autocommit.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.odbc-autocommit" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">odbc_autocommit</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">odbc_autocommit</span> &mdash; <span class="dc-title">Toggle autocommit behaviour</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.odbc-autocommit-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>odbc_autocommit</strong></span>(<span class="methodparam"><span class="type">Odbc\Connection</span> <code class="parameter">$odbc</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></span> <code class="parameter">$enable</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></span></div>

  <p class="para rdfs-comment">
   Toggles autocommit behaviour.
  </p>
  <p class="para">
   By default, auto-commit is on for a connection.  Disabling
   auto-commit is equivalent with starting a transaction.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.odbc-autocommit-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">odbc</code></dt>
     <dd>
      <p class="para">The ODBC connection object,
see <span class="function"><a href="function.odbc-connect.php" class="function">odbc_connect()</a></span> for details.</p>
     </dd>
    
    
     <dt><code class="parameter">enable</code></dt>
     <dd>
      <p class="para">
       If <code class="parameter">enable</code> is <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, auto-commit is enabled, if
       it is <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> auto-commit is disabled.
       If <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> is passed, this function returns the auto-commit status for
       <code class="parameter">odbc</code>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.odbc-autocommit-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   With a <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> <code class="parameter">enable</code> parameter, this function returns
   auto-commit status for <code class="parameter">odbc</code>. Non-zero is
   returned if auto-commit is on, 0 if it is off, or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> if an error
   occurs.
  </p>
  <p class="para">
   If <code class="parameter">enable</code> is non-null, this function returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> on
   success and <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.odbc-autocommit-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.4.0</td>
 <td>
  <code class="parameter">odbc</code> expects an <span class="classname"><strong class="classname">Odbc\Connection</strong></span>
  instance now; previously, a <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> was expected.
 </td>
</tr>

     <tr>
      <td>8.3.0</td>
      <td>
       <code class="parameter">enable</code> is now nullable.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.odbc-autocommit-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.odbc-commit.php" class="function" rel="rdfs-seeAlso">odbc_commit()</a> - Commit an ODBC transaction</span></li>
    <li><span class="function"><a href="function.odbc-rollback.php" class="function" rel="rdfs-seeAlso">odbc_rollback()</a> - Rollback a transaction</span></li>
   </ul>
  </p>
 </div>

</div><?php manual_footer($setup); ?>