<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.ibase.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.ibase-trans.php',
    1 => 'ibase_trans',
    2 => 'Begin a transaction',
  ),
  'up' => 
  array (
    0 => 'ref.ibase.php',
    1 => 'Firebird/InterBase Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.ibase-set-event-handler.php',
    1 => 'ibase_set_event_handler',
  ),
  'next' => 
  array (
    0 => 'function.ibase-wait-event.php',
    1 => 'ibase_wait_event',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ibase/functions/ibase-trans.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ibase-trans" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ibase_trans</h1>
  <p class="verinfo">(PHP 5, PHP 7 &lt; 7.4.0)</p><p class="refpurpose"><span class="refname">ibase_trans</span> &mdash; <span class="dc-title">Begin a transaction</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.ibase-trans-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ibase_trans</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$trans_args</code><span class="initializer"> = ?</span></span>, <span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$link_identifier</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span></div>

  <div class="methodsynopsis dc-description"><span class="methodname"><strong>ibase_trans</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$link_identifier</code><span class="initializer"> = ?</span></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$trans_args</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span></div>

  <p class="simpara">
   Begins a transaction.
  </p>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <span class="simpara">
    The first call to <span class="function"><strong>ibase_trans()</strong></span> will not return the default transaction
    of a connection. All transactions started by <span class="function"><strong>ibase_trans()</strong></span>
    will be rolled back at the end of the script if they were not committed or
    rolled back by either <span class="function"><a href="function.ibase-commit.php" class="function">ibase_commit()</a></span> or
    <span class="function"><a href="function.ibase-rollback.php" class="function">ibase_rollback()</a></span>.
   </span>
  </p></blockquote>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <span class="simpara">
    This function will accept multiple <code class="parameter">trans_args</code>
    and <code class="parameter">link_identifier</code> arguments. This allows transactions
    over multiple database connections, which are committed using a 2-phase commit
    algorithm. This means you can rely on the updates to either succeed in every
    database, or fail in every database. It does NOT mean you can use tables from
    different databases in the same query!
   </span>
   <span class="simpara">
    If you use transactions over multiple databases, you will have to specify both
    the <code class="parameter">link_id</code> and <code class="parameter">transaction_id</code>
    in calls to <span class="function"><a href="function.ibase-query.php" class="function">ibase_query()</a></span> and <span class="function"><a href="function.ibase-prepare.php" class="function">ibase_prepare()</a></span>.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ibase-trans-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <dl>
   
    <dt><code class="parameter">trans_args</code></dt>
    <dd>
     <span class="simpara">
      <code class="parameter">trans_args</code> can be a combination of
      <strong><code>IBASE_READ</code></strong>,
      <strong><code>IBASE_WRITE</code></strong>,
      <strong><code>IBASE_COMMITTED</code></strong>,
      <strong><code>IBASE_CONSISTENCY</code></strong>,
      <strong><code>IBASE_CONCURRENCY</code></strong>,
      <strong><code>IBASE_REC_VERSION</code></strong>,
      <strong><code>IBASE_REC_NO_VERSION</code></strong>,
      <strong><code>IBASE_WAIT</code></strong> and
      <strong><code>IBASE_NOWAIT</code></strong>.
     </span>
    </dd>
   
   
    <dt><code class="parameter">link_identifier</code></dt>
    <dd>
     <span class="simpara">
      An InterBase link identifier. If omitted, the last opened link is
      assumed.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ibase-trans-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="simpara">
   Returns a transaction handle, or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on error.
  </p>
 </div>


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