<?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 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.odbc-pconnect.php',
    1 => 'odbc_pconnect',
    2 => 'Open a persistent database connection',
  ),
  'up' => 
  array (
    0 => 'ref.uodbc.php',
    1 => 'ODBC Функції',
  ),
  'prev' => 
  array (
    0 => 'function.odbc-num-rows.php',
    1 => 'odbc_num_rows',
  ),
  'next' => 
  array (
    0 => 'function.odbc-prepare.php',
    1 => 'odbc_prepare',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/uodbc/functions/odbc-pconnect.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.odbc-pconnect" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">odbc_pconnect</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">odbc_pconnect</span> &mdash; <span class="dc-title">Open a persistent database connection</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.odbc-pconnect-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>odbc_pconnect</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$dsn</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<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.string.php" class="type string">string</a></span></span> <code class="parameter">$user</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<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.string.php" class="type string">string</a></span></span> <code class="parameter">$password</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$cursor_option</code><span class="initializer"> = <strong><code><a href="uodbc.constants.php#constant.sql-cur-use-driver">SQL_CUR_USE_DRIVER</a></code></strong></span></span><br>): <span class="type"><span class="type">Odbc\Connection</span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Opens a persistent database connection.
  </p>
  <p class="para">
   This function is much like
   <span class="function"><a href="function.odbc-connect.php" class="function">odbc_connect()</a></span>, except that the connection is
   not really closed when the script has finished.  Future requests
   for a connection with the same <code class="parameter">dsn</code>,
   <code class="parameter">user</code>, <code class="parameter">password</code>
   combination (via <span class="function"><a href="function.odbc-connect.php" class="function">odbc_connect()</a></span> and
   <span class="function"><strong>odbc_pconnect()</strong></span>) can reuse the persistent
   connection.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.odbc-pconnect-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   See <span class="function"><a href="function.odbc-connect.php" class="function">odbc_connect()</a></span> for details.
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.odbc-pconnect-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Returns an ODBC connection,  або <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> в разі помилки.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.odbc-pconnect-changelog">
  <h3 class="title">Журнал змін</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версія</th>
      <th>Опис</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.4.0</td>
  <td>
   This function returns a <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 returned.
  </td>
 </tr>

     <tr>
  <td>8.4.0</td>
  <td>
   <code class="parameter">user</code> and <code class="parameter">password</code> are now nullable,
   they are now also optional and default to <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>.
  </td>
 </tr>

 <tr>
  <td>8.4.0</td>
  <td>
   Previously, using an empty string for <code class="parameter">password</code> would not include
   <code class="literal">pwd</code> in the generated connection string for <code class="parameter">dsn</code>.
   It is now generated to include a <code class="literal">pwd</code> which has an empty string as its value.
   To restore the previous behaviour <code class="parameter">password</code> can now be set to <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>.
  </td>
 </tr>

 <tr>
  <td>8.4.0</td>
  <td>
   Previously, if <code class="parameter">dsn</code> contained <code class="literal">uid</code> or <code class="literal">pwd</code>
   both <code class="parameter">user</code> and <code class="parameter">password</code> parameters were ignored.
   Now <code class="parameter">user</code> is only ignored if <code class="parameter">dsn</code> contains
   <code class="literal">uid</code>, and <code class="parameter">password</code>  is only ignored if
   <code class="parameter">dsn</code> contains <code class="literal">pwd</code>.
  </td>
 </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 notes" id="refsect1-function.odbc-pconnect-notes">
  <h3 class="title">Примітки</h3>
  <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
   <span class="simpara">
    Persistent connections have no effect if PHP is used as a CGI
    program.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.odbc-pconnect-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.odbc-connect.php" class="function" rel="rdfs-seeAlso">odbc_connect()</a> - Connect to a datasource</span></li>
    <li><a href="features.persistent-connections.php" class="link">Persistent Database Connections</a></li>
   </ul>
  </p>
 </div>


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