<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.pgsql.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'tr',
  ),
  'this' => 
  array (
    0 => 'function.pg-execute.php',
    1 => 'pg_execute',
    2 => 'Sends a request to execute a prepared statement with given parameters, and waits for the result',
  ),
  'up' => 
  array (
    0 => 'ref.pgsql.php',
    1 => 'PostgreSQL İşlevleri',
  ),
  'prev' => 
  array (
    0 => 'function.pg-escape-string.php',
    1 => 'pg_escape_string',
  ),
  'next' => 
  array (
    0 => 'function.pg-fetch-all.php',
    1 => 'pg_fetch_all',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/pgsql/functions/pg-execute.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.pg-execute" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">pg_execute</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">pg_execute</span> &mdash; <span class="dc-title">Sends a request to execute a prepared statement with given parameters, and waits for the result</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.pg-execute-description">
  <h3 class="title">Açıklama</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>pg_execute</strong></span>(<span class="methodparam"><span class="type"><a href="class.pgsql-connection.php" class="type PgSql\Connection">PgSql\Connection</a></span> <code class="parameter">$connection</code><span class="initializer"> = ?</span></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$statement_name</code></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$params</code></span>): <span class="type"><span class="type"><a href="class.pgsql-result.php" class="type PgSql\Result">PgSql\Result</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
    Sends a request to execute a prepared statement with given parameters, and 
    waits for the result.
  </p>
  <p class="para">
    <span class="function"><strong>pg_execute()</strong></span> is like <span class="function"><a href="function.pg-query-params.php" class="function">pg_query_params()</a></span>, 
    but the command to be executed is 
    specified by naming a previously-prepared statement, instead of giving a 
    query string. This feature allows commands that will be used repeatedly to 
    be parsed and planned just once, rather than each time they are executed. 
    The statement must have been prepared previously in the current session. 
  </p>
  <p class="para">
    The parameters are identical to <span class="function"><a href="function.pg-query-params.php" class="function">pg_query_params()</a></span>, except that the name of a 
    prepared statement is given instead of a query string.
  </p>
 </div>


<div class="refsect1 parameters" id="refsect1-function.pg-execute-parameters">
  <h3 class="title">Bağımsız Değişkenler</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">connection</code></dt>
     <dd>
      <p class="para"><span class="classname"><a href="class.pgsql-connection.php" class="classname">PgSql\Connection</a></span>
nesnesi. <code class="parameter">bağlantı</code> belirtilmemişse öntanımlı bağlantı
kullanılır. Öntanımlı bağlantı <span class="function"><a href="function.pg-connect.php" class="function">pg_connect()</a></span>
veya <span class="function"><a href="function.pg-pconnect.php" class="function">pg_pconnect()</a></span> işleviyle kurulmuş son bağlantıdır.
<div class="warning"><strong class="warning">Uyarı</strong><p class="simpara">PHP 8.1.0 ve sonrasında, öntanımlı bağlantının kullanımı
önerilmemektedir.</p></div></p>
     </dd>
    
    
     <dt><code class="parameter">statement_name</code></dt>
     <dd>
      <p class="para">
       The name of the prepared statement to execute.  if
       &quot;&quot; is specified, then the unnamed statement is executed.  The name must have
       been previously prepared using <span class="function"><a href="function.pg-prepare.php" class="function">pg_prepare()</a></span>, 
       <span class="function"><a href="function.pg-send-prepare.php" class="function">pg_send_prepare()</a></span> or a <code class="literal">PREPARE</code> SQL
       command.
      </p>
     </dd>
    
    
     <dt><code class="parameter">params</code></dt>
     <dd>
      <p class="para">
        An array of parameter values to substitute for the $1, $2, etc. placeholders
        in the original prepared query string.  The number of elements in the array
        must match the number of placeholders.
      </p>
      <div class="warning"><strong class="warning">Uyarı</strong>
       <p class="para">
        Elements are converted to strings by calling this function.
       </p>
      </div>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.pg-execute-returnvalues">
  <h3 class="title">Dönen Değerler</h3>
  <p class="para">
    An <span class="classname"><a href="class.pgsql-result.php" class="classname">PgSql\Result</a></span> instance on success,  başarısızlık durumunda <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> döner.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.pg-execute-changelog">
  <h3 class="title">Sürüm Bilgisi</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Sürüm: </th>
      <th>Açıklama</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.1.0</td>
 <td>
  Artık <span class="classname"><a href="class.pgsql-result.php" class="classname">PgSql\Result</a></span> nesnesi dönüyor;
  evvelce bir özkaynak dönerdi.
 </td>
</tr>

     <tr>
 <td>8.1.0</td>
 <td>
  <code class="parameter">bağlantı</code> bağımsız değişkeni artık
  <span class="classname"><a href="class.pgsql-connection.php" class="classname">PgSql\Connection</a></span> nesnesi kabul ediyor, evvelce bir
  özkaynak kabul ederdi.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>

 
 <div class="refsect1 examples" id="refsect1-function.pg-execute-examples">
  <h3 class="title">Örnekler</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Örnek 1 Using <span class="function"><strong>pg_execute()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// Connect to a database named "mary"<br /></span><span style="color: #0000BB">$dbconn </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"dbname=mary"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Prepare a query for execution<br /></span><span style="color: #0000BB">$result </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_prepare</span><span style="color: #007700">(</span><span style="color: #0000BB">$dbconn</span><span style="color: #007700">, </span><span style="color: #DD0000">"my_query"</span><span style="color: #007700">, </span><span style="color: #DD0000">'SELECT * FROM shops WHERE name = $1'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Execute the prepared query.  Note that it is not necessary to escape<br />// the string "Joe's Widgets" in any way<br /></span><span style="color: #0000BB">$result </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$dbconn</span><span style="color: #007700">, </span><span style="color: #DD0000">"my_query"</span><span style="color: #007700">, array(</span><span style="color: #DD0000">"Joe's Widgets"</span><span style="color: #007700">));<br /><br /></span><span style="color: #FF8000">// Execute the same prepared query, this time with a different parameter<br /></span><span style="color: #0000BB">$result </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$dbconn</span><span style="color: #007700">, </span><span style="color: #DD0000">"my_query"</span><span style="color: #007700">, array(</span><span style="color: #DD0000">"Clothes Clothes Clothes"</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.pg-execute-seealso">
  <h3 class="title">Ayrıca Bakınız</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.pg-prepare.php" class="function" rel="rdfs-seeAlso">pg_prepare()</a> - Submits a request to the server to create a prepared statement with the
   given parameters, and waits for completion</span></li>
    <li><span class="function"><a href="function.pg-send-prepare.php" class="function" rel="rdfs-seeAlso">pg_send_prepare()</a> - Sends a request to create a prepared statement with the given parameters, without waiting for completion</span></li>
    <li><span class="function"><a href="function.pg-query-params.php" class="function" rel="rdfs-seeAlso">pg_query_params()</a> - Submits a command to the server and waits for the result, with the ability to pass parameters separately from the SQL command text</span></li>
   </ul>
  </p>
 </div>

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