<?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-execute.php',
    1 => 'ibase_execute',
    2 => 'Execute a previously prepared query',
  ),
  'up' => 
  array (
    0 => 'ref.ibase.php',
    1 => 'Firebird/InterBase Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.ibase-errmsg.php',
    1 => 'ibase_errmsg',
  ),
  'next' => 
  array (
    0 => 'function.ibase-fetch-assoc.php',
    1 => 'ibase_fetch_assoc',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ibase/functions/ibase-execute.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ibase-execute" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ibase_execute</h1>
  <p class="verinfo">(PHP 5, PHP 7 &lt; 7.4.0)</p><p class="refpurpose"><span class="refname">ibase_execute</span> &mdash; <span class="dc-title">Execute a previously prepared query</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.ibase-execute-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ibase_execute</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$query</code></span>, <span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">...$values</code></span>): <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span></div>

  <p class="simpara">
   Execute a query prepared by <span class="function"><a href="function.ibase-prepare.php" class="function">ibase_prepare()</a></span>.
  </p>
  <p class="simpara">
   This is a lot more effective than using <span class="function"><a href="function.ibase-query.php" class="function">ibase_query()</a></span>
   if you are repeating a same kind of query several times with only
   some parameters changing.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ibase-execute-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <dl>
   
    <dt><code class="parameter">query</code></dt>
    <dd>
     <span class="simpara">
      An InterBase query prepared by <span class="function"><a href="function.ibase-prepare.php" class="function">ibase_prepare()</a></span>.
     </span>
    </dd>
   
   
    <dt><code class="parameter">values</code></dt>
    <dd>
     <span class="simpara">
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ibase-execute-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="simpara">
   If the query raises an error, returns <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>. If it is successful and
   there is a (possibly empty) result set (such as with a SELECT query),
   returns a result identifier. If the query was successful and there were
   no results, returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>.
  </p>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <span class="simpara">
    This function returns the number of rows affected by
    the query (if &gt; 0 and applicable to the statement type). A query that
    succeeded, but did not affect any rows (e.g. an UPDATE of a non-existent
    record) will return <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 examples" id="refsect1-function.ibase-execute-examples">
  <h3 class="title">Esempi</h3>
  <div class="example" id="example-1">
   <p><strong>Example #1 <span class="function"><strong>ibase_execute()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$dbh </span><span style="color: #007700">= </span><span style="color: #0000BB">ibase_connect</span><span style="color: #007700">(</span><span style="color: #0000BB">$host</span><span style="color: #007700">, </span><span style="color: #0000BB">$username</span><span style="color: #007700">, </span><span style="color: #0000BB">$password</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$updates </span><span style="color: #007700">= array(<br />    </span><span style="color: #0000BB">1 </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Eric'</span><span style="color: #007700">,<br />    </span><span style="color: #0000BB">5 </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Filip'</span><span style="color: #007700">,<br />    </span><span style="color: #0000BB">7 </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Larry'<br /></span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$query </span><span style="color: #007700">= </span><span style="color: #0000BB">ibase_prepare</span><span style="color: #007700">(</span><span style="color: #0000BB">$dbh</span><span style="color: #007700">, </span><span style="color: #DD0000">"UPDATE FOO SET BAR = ? WHERE BAZ = ?"</span><span style="color: #007700">);<br /><br />foreach (</span><span style="color: #0000BB">$updates </span><span style="color: #007700">as </span><span style="color: #0000BB">$baz </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$bar</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">ibase_execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$query</span><span style="color: #007700">, </span><span style="color: #0000BB">$bar</span><span style="color: #007700">, </span><span style="color: #0000BB">$baz</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ibase-execute-seealso">
  <h3 class="title">Vedere anche:</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.ibase-query.php" class="function" rel="rdfs-seeAlso">ibase_query()</a> - Execute a query on an InterBase database</span></li>
  </ul>
 </div>


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