Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 10712

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>ODBC and DB2 Functions (PDO_ODBC)</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="ref.pdo-oci.connection.html">PDO_OCI DSN</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="ref.pdo-odbc.connection.html">PDO_ODBC DSN</a></div>
 <div class="up"><a href="pdo.drivers.html">PDO Drivers</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="ref.pdo-odbc" class="reference">
  
  <h1 class="title">ODBC and DB2 Functions (PDO_ODBC)</h1>
  
  <div class="partintro">

   <div class="section" id="pdo-odbc.intro">
   <h2 class="title">Introduction</h2>
    <p class="para">
     PDO_ODBC is a driver that implements the <a href="intro.pdo.html" class="link">PHP Data
     Objects (PDO) interface</a>
     to enable access from PHP to databases through ODBC drivers or through the
     IBM DB2 Call Level Interface (DB2 CLI) library. PDO_ODBC currently supports
     three different &quot;flavours&quot; of database drivers:
     <dl>

      <dt>

       <span class="term">ibm-db2</span>
       <dd>

        <p class="para">
         Supports access to IBM DB2 Universal Database, Cloudscape, and Apache
         Derby servers through the free DB2 client.
        </p>
       </dd>

      </dt>

      <dt>

       <span class="term">unixODBC</span>
       <dd>

        <p class="para">
         Supports access to database servers through the unixODBC driver
         manager and the database&#039;s own ODBC drivers. 
        </p>
       </dd>

      </dt>

      <dt>

       <span class="term">generic</span>
       <dd>

        <p class="para">
         Offers a compile option for ODBC driver managers that are not
         explicitly supported by PDO_ODBC.
        </p>
       </dd>

      </dt>

     </dl>

    </p>
    <p class="para">
     On Windows, PDO_ODBC is built into the PHP core by default. It is linked
     against the Windows ODBC Driver Manager so that PHP can connect to any
     database cataloged as a System DSN, and is the recommended driver for
     connecting to Microsoft SQL Server databases.
    </p>
   </div>

   
   

<div class="section" id="ref.pdo-odbc.installation">
 <h2 class="title">Installation</h2>
 <div class="procedure">
  <strong class="title">PDO_ODBC on UNIX systems</strong>
  <ol type="1"><li>
   <p class="para">
    As of PHP 5.1, PDO_ODBC is included in the PHP source. You can compile the
    PDO_ODBC extension as either a static or shared module using the following
    <strong class="command">configure</strong> commands.
    <dl>

     <dt>

      <span class="term">ibm_db2</span>
      <dd>

       <p class="para">
        <div class="example-contents screen"><div class="cdata"><pre>
./configure --with-pdo-odbc=ibm-db2,/opt/IBM/db2/V8.1/
</pre></div></div>
        To build PDO_ODBC with the ibm-db2 flavour, you have to have
        previously installed the DB2 application development headers on the
        same machine on which you are compiling PDO_ODBC. The DB2 application
        development headers are an installable option in the DB2 servers, and
        are also available as part of the DB2 Application Development Client
        freely available for download from the IBM DB2 Universal Database
        <a href="http://www-306.ibm.com/software/data/db2/udb/support/downloadv8.html" class="link external">&raquo;&nbsp;support site</a>.
       </p>
       <p class="para">
        If you do not supply a location for the DB2 libraries and headers to
        the <strong class="command">configure</strong> command, PDO_ODBC defaults to
        <var class="filename">/home/db2inst1/sqllib</var>.
       </p>
      </dd>

     </dt>

     <dt>

      <span class="term">unixODBC</span>
      <dd>

       <p class="para">
        <div class="example-contents screen"><div class="cdata"><pre>
./configure --with-pdo-odbc=unixODBC,/usr/local
</pre></div></div>
        If you do not supply a location for the unixODBC libraries and
        headers to the <strong class="command">configure</strong> command, PDO_ODBC
        defaults to <var class="filename">/usr/local</var>.
       </p>
      </dd>

     </dt>

     <dt>

      <span class="term">generic</span>
      <dd>

       <div class="example-contents screen"><div class="cdata"><pre>
./configure --with-pdo-odbc=generic,/usr/local,libname,ldflags,cflags
</pre></div></div>
      </dd>

     </dt>

    </dl>

   </p>
  </li>
 </ol></div>
</div>



  
   

<div class="section" id="pdo-odbc.configuration">
 <h2 class="title">Runtime Configuration</h2>
 <p class="simpara">
The behaviour of these functions is affected by settings in <var class="filename">php.ini</var>.
</p>
 <p class="para">
  <table class="doctable table">
   <caption><strong>PDO_ODBC Configuration Options</strong></caption>
   
    <thead>
     <tr>
      <th>Name</th>
      <th>Default</th>
      <th>Changeable</th>
      <th>Changelog</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td><a href="ref.pdo-odbc.html#ini.pdo-odbc.connection-pooling" class="link">pdo_odbc.connection_pooling</a></td>
      <td>&quot;strict&quot;</td>
      <td>PHP_INI_ALL</td>
      <td>Available since PHP 5.1.0.</td>
     </tr>

     <tr>
      <td><a href="ref.pdo-odbc.html#ini.pdo-odbc.db2-instance-name" class="link">pdo_odbc.db2_instance_name</a></td>
      <td>NULL</td>
      <td>PHP_INI_SYSTEM</td>
      <td>Available since PHP 5.1.1. This deprecated feature <em class="emphasis">will</em>
certainly be <em class="emphasis">removed</em> in the future.</td>
     </tr>

    </tbody>
   
  </table>

  For further details and definitions of the
PHP_INI_* modes, see the <a href="configuration.changes.modes.html" class="xref">Where a configuration setting may be set</a>.
</p>

<p class="para">Here&#039;s a short explanation of
the configuration directives.</p>

<p class="para">
 <dl>

   <dt id="ini.pdo-odbc.connection-pooling">
   <span class="term">
    <em><code class="parameter">pdo_odbc.connection_pooling</code></em>
    <span class="type"><a href="language.types.string.html" class="type string">string</a></span>
   </span>
   <dd>

    <p class="para">
     Whether to pool ODBC connections. Can be one of <em>&quot;strict&quot;</em>,
     <em>&quot;relaxed&quot;</em> or <em>&quot;off&quot;</em> (equals to
     <em>&quot;&quot;</em>). The parameter describes how strict the connection
     manager should be when matching connection parameters to existing pooled
     connections.  <strong class="userinput"><code>strict</code></strong> is the recommend default, and
     will result in the use of cached connections only when all the connection
     parameters match exactly.  <strong class="userinput"><code>relaxed</code></strong> will result in
     the use of cached connections when similar connection parameters are
     used.  This can result in increased use of the cache, at the risk of
     bleeding connection information between (for example) virtual hosts.
    </p>
    <p class="para">
     This setting can only be changed from the <var class="filename">php.ini</var>
     file, and affects the entire process; any other modules loaded into the
     process that use the same ODBC libraries will be affected too, including
     the <a href="ref.uodbc.html" class="link">Unified ODBC extension</a>.
    </p>
    <div class="warning"><strong class="warning">Warning</strong>
     <p class="para">
      <strong class="userinput"><code>relaxed</code></strong> matching should not be used on a shared
      server, for security reasons.
     </p>
    </div>
    <div class="tip"><strong class="tip">Tip</strong>
     <p class="para">
      Leave this setting at the default <strong class="userinput"><code>strict</code></strong> setting
      unless you have good reason to change it.
     </p>
    </div>
   </dd>

  </dt>

  <dt id="ini.pdo-odbc.db2-instance-name">
   <span class="term">
    <em><code class="parameter">pdo_odbc.db2_instance_name</code></em>
    <span class="type"><a href="language.types.string.html" class="type string">string</a></span>
   </span>
   <dd>

    <p class="para">
     If you compile PDO_ODBC using the <em>db2</em> flavour,
     this setting sets the value of the DB2INSTANCE environment variable on
     Linux and UNIX operating systems to the specified name of the DB2
     instance. This enables PDO_ODBC to resolve the location of the DB2
     libraries and make cataloged connections to DB2 databases.
    </p>
    <p class="para">
     This setting can only be changed from the <var class="filename">php.ini</var>
     file, and affects the entire process; any other modules loaded into the
     process that use the same ODBC libraries will be affected too, including
     the <a href="ref.uodbc.html" class="link">Unified ODBC extension</a>.
    </p>
    <p class="para">
     This setting has no effect on Windows.
    </p>
   </dd>

  </dt>

  
 </dl>

 </p>
</div>



  </div>

  

 <h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="ref.pdo-odbc.connection.html">PDO_ODBC DSN</a> — Connecting to ODBC or DB2 databases</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="ref.pdo-oci.connection.html">PDO_OCI DSN</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="ref.pdo-odbc.connection.html">PDO_ODBC DSN</a></div>
 <div class="up"><a href="pdo.drivers.html">PDO Drivers</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>