Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 10718

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>Microsoft SQL Server Functions (PDO_SQLSRV)</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="ref.pdo-mysql.connection.html">PDO_MYSQL DSN</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="ref.pdo-sqlsrv.connection.html">PDO_SQLSRV 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-sqlsrv" class="reference">
  <h1 class="title">Microsoft SQL Server Functions (PDO_SQLSRV)</h1>
  
  <div class="partintro">

   <div class="section" id="pdo-sqlsrv.intro">
   <h2 class="title">Introduction</h2>
    <p class="para">
     PDO_SQLSRV 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 MS SQL Server (starting with SQL Server 2005) 
     and SQL Azure databases.
    </p>
   </div>
   

<div class="section" id="ref.pdo-sqlsrv.installation">
 <h2 class="title">Installation</h2>
 <p class="para">
  The PDO_SQLSRV extension is enabled by adding appropriate DLL file to your PHP 
  extension directory and the corresponding entry to the <var class="filename">php.ini</var> file. The 
  PDO_SQLSRV download comes 8 driver files, four of which are for PDO support. 
  If you are running non-thread-safe PHP (PHP 5.3), use the php_pdo_sqlsrv_53_nts.dll 
  file. (You should use a non-thread-safe version if you are using IIS as your 
  web server). If you are running thread-safe PHP, use the php_pdo_sqlsrv_53_ts.dll 
  file. Similarly for PHP 5.4, use the php_pdo_sqlsrv_54_nts.dll or php_pdo_sqlsrv_54_ts.dll
  depending on whether your PHP installation is non-thread-safe or thread-safe. 
 </p>
 <p class="para">
  The most recent version of the driver is available for download here:
  <a href="http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx" class="link external">&raquo;&nbsp;SQLSRV 3.0 download</a>. If you need support 
  for PHP 5.2 and/or PHP compiled with VC6, use the 2.0 release of the driver: 
  <a href="http://download.microsoft.com/download/C/D/B/CDB0A3BB-600E-42ED-8D5E-E4630C905371/SQLSRV20.EXE" class="link external">&raquo;&nbsp;SQLSRV 2.0 download</a>.
 </p>
 <p class="para">
  For more information about system requirements, see 
  <a href="http://msdn.microsoft.com/en-us/library/cc296170.aspx" class="link external">&raquo;&nbsp;SQLSRV System Requirements</a>.
 </p>
 <p class="para">
  The PDO_SQLSRV extension is only compatible with PHP running on Windows.
  For Linux, see <a href="ref.pdo-odbc.html" class="link">ODBC</a> and
  <a href="http://www.microsoft.com/download/en/details.aspx?id=28160" class="link external">&raquo;&nbsp;Microsoft&#039;s SQL Server ODBC Driver for Linux</a>.
 </p>
</div>



   

<div class="section" id="pdo-sqlsrv.constants">
 <h2 class="title">Predefined Constants</h2>
 <p class="simpara">The constants below are defined by
this driver, and will only be available when the extension has been either
compiled into PHP or dynamically loaded at runtime. In addition, these
driver-specific constants should only be used if you are using this driver.
Using driver-specific attributes with another driver may result in
unexpected behaviour.  <span class="function"><a href="pdo.getattribute.html" class="function">PDO::getAttribute()</a></span> may be used to
obtain the <strong><code>PDO_ATTR_DRIVER_NAME</code></strong> attribute to check the
driver, if your code can run against multiple drivers.</p>
 <dl>

  <dt id="pdo.constants.sqlsrv-txn-read-uncommitted">
   <span class="term">
    <strong><code>PDO::SQLSRV_TXN_READ_UNCOMMITTED</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </span>
   <dd>

    <span class="simpara">
     This constant is an acceptable value for the SQLSRV DSN key TransactionIsolation. 
     This constant sets the transaction isolation level for the connection to 
     Read Uncommitted.
    </span>
   </dd>

  </dt>

  <dt id="pdo.constants.sqlsrv-txn-read-committed">
   <span class="term">
    <strong><code>PDO::SQLSRV_TXN_READ_COMMITTED</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </span>
   <dd>

    <span class="simpara">
     This constant is an acceptable value for the SQLSRV DSN key TransactionIsolation. 
     This constant sets the transaction isolation level for the connection to 
     Read Committed.
    </span>
   </dd>

  </dt>

  <dt id="pdo.constants.sqlsrv-txn-repeatable-read">
   <span class="term">
    <strong><code>PDO::SQLSRV_TXN_REPEATABLE_READ</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </span>
   <dd>

    <span class="simpara">
     This constant is an acceptable value for the SQLSRV DSN key TransactionIsolation. 
     This constant sets the transaction isolation level for the connection to 
     Repeateable Read.
    </span>
   </dd>

  </dt>

  <dt id="pdo.constants.sqlsrv-txn-snapshot">
   <span class="term">
    <strong><code>PDO::SQLSRV_TXN_SNAPSHOT</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </span>
   <dd>

    <span class="simpara">
     This constant is an acceptable value for the SQLSRV DSN key TransactionIsolation. 
     This constant sets the transaction isolation level for the connection to Snapshot.
    </span>
   </dd>

  </dt>

  <dt id="pdo.constants.sqlsrv-txn-serializable">
   <span class="term">
    <strong><code>PDO::SQLSRV_TXN_SERIALIZABLE</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </span>
   <dd>

    <span class="simpara">
     This constant is an acceptable value for the SQLSRV DSN key TransactionIsolation. 
     This constant sets the transaction isolation level for the connection to 
     Serializable.
    </span>
   </dd>

  </dt>

  <dt id="pdo.constants.sqlsrv-encoding-binary">
   <span class="term">
    <strong><code>PDO::SQLSRV_ENCODING_BINARY</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </span>
   <dd>

    <span class="simpara">
     Specifies that data is sent/retrieved as a raw byte stream to/from the server 
     without performing encoding or translation. This constant can be passed to 
     PDOStatement::setAttribute, PDO::prepare, PDOStatement::bindColumn, and 
     PDOStatement::bindParam.
    </span>
   </dd>

  </dt>

  <dt id="pdo.constants.sqlsrv-encoding-system">
   <span class="term">
    <strong><code>PDO::SQLSRV_ENCODING_SYSTEM</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </span>
   <dd>

    <span class="simpara">
     Specifies that data is sent/retrieved to/from the server as 8-bit characters 
     as specified in the code page of the Windows locale that is set on the system. 
     Any multi-byte characters or characters that do not map into this code page 
     are substituted with a single byte question mark (?) character. This constant 
     can be passed to PDOStatement::setAttribute, PDO::setAttribute, PDO::prepare, 
     PDOStatement::bindColumn, and PDOStatement::bindParam.
    </span>
   </dd>

  </dt>

  <dt id="pdo.constants.sqlsrv-encoding-utf8">
   <span class="term">
    <strong><code>PDO::SQLSRV_ENCODING_UTF8</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </span>
   <dd>

    <span class="simpara">
     Specifies that data is sent/retrieved to/from the server in UTF-8 encoding. 
     This is the default encoding. This constant can be passed to 
     PDOStatement::setAttribute, PDO::setAttribute, PDO::prepare, 
     PDOStatement::bindColumn, and PDOStatement::bindParam.
    </span>
   </dd>

  </dt>

  <dt id="pdo.constants.sqlsrv-encoding-default">
   <span class="term">
    <strong><code>PDO::SQLSRV_ENCODING_DEFAULT</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </span>
   <dd>

    <span class="simpara">
     Specifies that data is sent/retrieved to/from the server according to 
     PDO::SQLSRV_ENCODING_SYSTEM if specified during connection. The connection&#039;s 
     encoding is used if specified in a prepare statement. This constant can be 
     passed to PDOStatement::setAttribute, PDO::setAttribute, PDO::prepare, 
     PDOStatement::bindColumn, and PDOStatement::bindParam.
    </span>
   </dd>

  </dt>

  <dt id="pdo.constants.sqlsrv-attr-query-timeout">
   <span class="term">
    <strong><code>PDO::SQLSRV_ATTR_QUERY_TIMEOUT</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </span>
   <dd>

    <span class="simpara">
     A non-negative integer representing the timeout period, in seconds. Zero (0) 
     is the default and means no timeout. This constant can be passed to 
     PDOStatement::setAttribute, PDO::setAttribute, and PDO::prepare.
    </span>
   </dd>

  </dt>

  <dt id="pdo.constants.sqlsrv-attr-direct-query">
   <span class="term">
    <strong><code>PDO::SQLSRV_ATTR_DIRECT_QUERY</code></strong>
     (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
   </span>
   <dd>

    <span class="simpara">
     Indicates that a query should be executed directly, without being prepared. 
     This constant can be passed to PDO::setAttribute, and PDO::prepare. For more 
     information, see 
     <a href="http://msdn.microsoft.com/en-us/library/ff754356.aspx" class="link external">&raquo;&nbsp;Direct and Prepared Statement Execution</a>.
    </span>
   </dd>

  </dt>

 </dl>

</div>



  </div>

  

 <h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="ref.pdo-sqlsrv.connection.html">PDO_SQLSRV DSN</a> — Connecting to MS SQL Server and SQL Azure 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-mysql.connection.html">PDO_MYSQL DSN</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="ref.pdo-sqlsrv.connection.html">PDO_SQLSRV 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>