<?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-send-prepare.php',
    1 => 'pg_send_prepare',
    2 => 'Sends a request to create a prepared statement with the given parameters, without waiting for completion',
  ),
  'up' => 
  array (
    0 => 'ref.pgsql.php',
    1 => 'PostgreSQL İşlevleri',
  ),
  'prev' => 
  array (
    0 => 'function.pg-send-execute.php',
    1 => 'pg_send_execute',
  ),
  'next' => 
  array (
    0 => 'function.pg-send-query.php',
    1 => 'pg_send_query',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/pgsql/functions/pg-send-prepare.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.pg-send-prepare" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">pg_send_prepare</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">pg_send_prepare</span> &mdash; <span class="dc-title">Sends a request to create a prepared statement with the given parameters, without waiting for completion</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.pg-send-prepare-description">
  <h3 class="title">Açıklama</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>pg_send_prepare</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>, <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.string.php" class="type string">string</a></span> <code class="parameter">$query</code></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">
    Sends a request to create a prepared statement with the given parameters, 
    without waiting for completion.
  </p>
  <p class="para">
    This is an asynchronous version of <span class="function"><a href="function.pg-prepare.php" class="function">pg_prepare()</a></span>: it returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> if it was able to 
    dispatch the request, and <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> if not. After a successful call, call 
    <span class="function"><a href="function.pg-get-result.php" class="function">pg_get_result()</a></span> to determine whether the server successfully created the 
    prepared statement. The function&#039;s parameters are handled identically to 
    <span class="function"><a href="function.pg-prepare.php" class="function">pg_prepare()</a></span>. Like <span class="function"><a href="function.pg-prepare.php" class="function">pg_prepare()</a></span>, it will not work 
    on pre-7.4 versions of PostgreSQL.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.pg-send-prepare-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">
PostgreSQL veritabanı bağlantısı özkaynağı.</p>
     </dd>
    
    
     <dt><code class="parameter">statement_name</code></dt>
     <dd>
      <p class="para">
       The name to give the prepared statement.  Must be unique per-connection.  If
       &quot;&quot; is specified, then an unnamed statement is created, overwriting any
       previously defined unnamed statement.
      </p>
     </dd>
    
    
     <dt><code class="parameter">query</code></dt>
     <dd>
      <p class="para">
       The parameterized SQL statement.  Must contain only a single statement.
       (multiple statements separated by semi-colons are not allowed.)  If any parameters 
       are used, they are referred to as $1, $2, etc.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.pg-send-prepare-returnvalues">
  <h3 class="title">Dönen Değerler</h3>
  <p class="para">
   Returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> on success, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> or <code class="literal">0</code> on failure.  Use <span class="function"><a href="function.pg-get-result.php" class="function">pg_get_result()</a></span>
   to determine the query result.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.pg-send-prepare-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>
  <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-send-prepare-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_send_prepare()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />  $dbconn </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"dbname=publisher"</span><span style="color: #007700">) or die(</span><span style="color: #DD0000">"Could not connect"</span><span style="color: #007700">);<br /><br />  </span><span style="color: #FF8000">// Prepare a query for execution<br />  </span><span style="color: #007700">if (!</span><span style="color: #0000BB">pg_connection_busy</span><span style="color: #007700">(</span><span style="color: #0000BB">$dbconn</span><span style="color: #007700">)) {<br />    </span><span style="color: #0000BB">pg_send_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 />    </span><span style="color: #0000BB">$res1 </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_get_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$dbconn</span><span style="color: #007700">);<br />  }<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: #007700">if (!</span><span style="color: #0000BB">pg_connection_busy</span><span style="color: #007700">(</span><span style="color: #0000BB">$dbconn</span><span style="color: #007700">)) {<br />    </span><span style="color: #0000BB">pg_send_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 />    </span><span style="color: #0000BB">$res2 </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_get_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$dbconn</span><span style="color: #007700">);<br />  }<br />  <br />  </span><span style="color: #FF8000">// Execute the same prepared query, this time with a different parameter<br />  </span><span style="color: #007700">if (!</span><span style="color: #0000BB">pg_connection_busy</span><span style="color: #007700">(</span><span style="color: #0000BB">$dbconn</span><span style="color: #007700">)) {<br />    </span><span style="color: #0000BB">pg_send_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 />    </span><span style="color: #0000BB">$res3 </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_get_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$dbconn</span><span style="color: #007700">);<br />  }<br />  <br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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

 
 <div class="refsect1 seealso" id="refsect1-function.pg-send-prepare-seealso">
  <h3 class="title">Ayrıca Bakınız</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.pg-connect.php" class="function" rel="rdfs-seeAlso">pg_connect()</a> - Open a PostgreSQL connection</span></li>
    <li><span class="function"><a href="function.pg-pconnect.php" class="function" rel="rdfs-seeAlso">pg_pconnect()</a> - Open a persistent PostgreSQL connection</span></li>
    <li><span class="function"><a href="function.pg-execute.php" class="function" rel="rdfs-seeAlso">pg_execute()</a> - Sends a request to execute a prepared statement with given parameters, and waits for the result</span></li>
    <li><span class="function"><a href="function.pg-send-execute.php" class="function" rel="rdfs-seeAlso">pg_send_execute()</a> - Sends a request to execute a prepared statement with given parameters, without waiting for the result(s)</span></li>
    <li><span class="function"><a href="function.pg-send-query-params.php" class="function" rel="rdfs-seeAlso">pg_send_query_params()</a> - Submits a command and separate parameters to the server without waiting for the result(s)</span></li>
   </ul>
  </p>
 </div>

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