1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-23 23:32:18 +01:00

sqlsrv: fix XML by converting para to simpara tags via script

This commit is contained in:
Gina Peter Banyard
2026-01-26 15:26:38 +00:00
parent 2471b0dc9b
commit c758e862cf
30 changed files with 265 additions and 272 deletions

View File

@@ -1,36 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<book xml:id="book.sqlsrv" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="book.sqlsrv">
<?phpdoc extension-membership="pecl" ?>
<title>Microsoft SQL Server Driver for PHP</title>
<titleabbrev>SQLSRV</titleabbrev>
<!-- {{{ preface -->
<preface xml:id="intro.sqlsrv">
&reftitle.intro;
<para>
The SQLSRV extension allows you to access Microsoft SQL Server and SQL Azure
databases. The 3.0 release of the driver supports
<simpara>
The SQLSRV extension allows you to access Microsoft SQL Server and SQL Azure
databases. The 3.0 release of the driver supports
SQL Server, beginning with SQL Server 2005, including SQL Server 2012 and SQL
Server 2012 LocalDB. (For more information about LocalDB, see
<link xlink:href="&url.sqlsrv.localdb;">PHP Driver for SQL Server Support for LocalDB</link>
Server 2012 LocalDB. (For more information about LocalDB, see
<link xlink:href="&url.sqlsrv.localdb;">PHP Driver for SQL Server Support for LocalDB</link>
and <link xlink:href="&url.sqlsrv.localdbinfo;">SQL Server 2012 Express LocalDB</link>.)
</para>
<para>
The SQLSRV extension is supported by Microsoft and available for download here:
<link xlink:href="&url.sqlsrv;">&url.sqlsrv;</link>. SQL Server 2012 LocalDB can be
downloaded here: <link xlink:href="&url.sqlsrv.localdbdownload;">&url.sqlsrv.localdbdownload;</link>.
</para>
</simpara>
<simpara>
The SQLSRV extension is supported by Microsoft and available for download here:
<link xlink:href="&url.sqlsrv;">&url.sqlsrv;</link>. SQL Server 2012 LocalDB can be
downloaded here: <link xlink:href="&url.sqlsrv.localdbdownload;">&url.sqlsrv.localdbdownload;</link>.
</simpara>
</preface>
<!-- }}} -->
&reference.sqlsrv.setup;
&reference.sqlsrv.constants;
&reference.sqlsrv.reference;
</book>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
@@ -51,4 +49,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View File

@@ -1,25 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<section xml:id="sqlsrv.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sqlsrv.installation">
&reftitle.install;
<para>
The SQLSRV extension is enabled by adding appropriate DLL file to your PHP
extension directory and the corresponding entry to the &php.ini; file. The SQLSRV
download comes with 8 driver files, four of which are for PDO support.
</para>
<para>
<simpara>
The SQLSRV extension is enabled by adding appropriate DLL file to your PHP
extension directory and the corresponding entry to the &php.ini; file. The SQLSRV
download comes with 8 driver files, four of which are for PDO support.
</simpara>
<simpara>
The most recent version of the driver is available for download here:
<link xlink:href="&url.sqlsrv;">SQLSRV download</link>.
</para>
<para>
For more information about SQLSRV requirements, see
</simpara>
<simpara>
For more information about SQLSRV requirements, see
<link xlink:href="&url.sqlsrv.system.requirements;">SQLSRV System Requirements</link>.
</para>
<para>
</simpara>
<simpara>
Since version 4.0 the SQLSRV extension is compatible only with PHP 7.0 running on Linux or Windows.
</para>
</simpara>
</section>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View File

@@ -11,7 +11,7 @@
<type>bool</type><methodname>sqlsrv_begin_transaction</methodname>
<methodparam><type>resource</type><parameter>conn</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
The transaction begun by <function>sqlsrv_begin_transaction</function> includes
all statements that were executed after the call to
<function>sqlsrv_begin_transaction</function> and before calls to
@@ -20,7 +20,7 @@
these functions instead of executing SQL statements that begin and commit/roll
back transactions. For more information, see
<link xlink:href="&url.sqlsrv.transaction.handling;">SQLSRV Transactions</link>.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -28,9 +28,9 @@
<varlistentry>
<term><parameter>conn</parameter></term>
<listitem>
<para>
<simpara>
The connection resource returned by a call to <function>sqlsrv_connect</function>.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -38,20 +38,20 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
&return.success;
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>sqlsrv_begin_transaction</function> example</title>
<para>
<simpara>
The following example demonstrates how to use
<function>sqlsrv_begin_transaction</function> together with
<function>sqlsrv_commit</function> and <function>sqlsrv_rollback</function>.
</para>
</simpara>
<programlisting role="php">
<![CDATA[
<?php

View File

@@ -11,14 +11,14 @@
<type>bool</type><methodname>sqlsrv_cancel</methodname>
<methodparam><type>resource</type><parameter>stmt</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Cancels a statement. Any results associated with the statement that have not
been consumed are deleted. After <function>sqlsrv_cancel</function> has been
called, the specified statement can be re-executed if it was created with
<function>sqlsrv_prepare</function>. Calling <function>sqlsrv_cancel</function>
is not necessary if all the results associated with the statement have been
consumed.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -27,9 +27,9 @@
<varlistentry>
<term><parameter>stmt</parameter></term>
<listitem>
<para>
<simpara>
The statement resource to be cancelled.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -37,9 +37,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
&return.success;
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
@@ -91,13 +91,13 @@ sqlsrv_cancel( $stmt);
<refsect1 role="notes">
&reftitle.notes;
<para>
<simpara>
The main difference between <function>sqlsrv_cancel</function> and
<function>sqlsrv_free_stmt</function> is that a statement resource cancelled with
<function>sqlsrv_cancel</function> can be re-executed if it was created with
<function>sqlsrv_prepare</function>. A statement resource cancelled with
<function>sqlsrv_free_statement</function> cannot be re-executed.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">

View File

@@ -11,9 +11,9 @@
<type>array</type><methodname>sqlsrv_client_info</methodname>
<methodparam><type>resource</type><parameter>conn</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Returns information about the client and specified connection
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -22,9 +22,9 @@
<varlistentry>
<term><parameter>conn</parameter></term>
<listitem>
<para>
<simpara>
The connection about which information is returned.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>

View File

@@ -11,9 +11,9 @@
<type>bool</type><methodname>sqlsrv_close</methodname>
<methodparam><type>resource</type><parameter>conn</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Closes an open connection and releases resourses associated with the connection.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -22,9 +22,9 @@
<varlistentry>
<term><parameter>conn</parameter></term>
<listitem>
<para>
<simpara>
The connection to be closed.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -32,9 +32,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
&return.success;
</para>
</simpara>
</refsect1>
<refsect1 role="examples">

View File

@@ -11,7 +11,7 @@
<type>bool</type><methodname>sqlsrv_commit</methodname>
<methodparam><type>resource</type><parameter>conn</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Commits a transaction that was begun with <function>sqlsrv_begin_transaction</function>.
The connection is returned to auto-commit mode after <function>sqlsrv_commit</function>
is called. The transaction that is committed includes all statements that were
@@ -20,7 +20,7 @@
functions instead of executing SQL statements that begin and commit/roll back
transactions. For more information, see
<link xlink:href="&url.sqlsrv.transaction.handling;">SQLSRV Transactions</link>.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -29,9 +29,9 @@
<varlistentry>
<term><parameter>conn</parameter></term>
<listitem>
<para>
<simpara>
The connection on which the transaction is to be committed.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -39,20 +39,20 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
&return.success;
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>sqlsrv_commit</function> example</title>
<para>
<simpara>
The following example demonstrates how to use <function>sqlsrv_commit</function>
together with <function>sqlsrv_begin_transaction</function> and
<function>sqlsrv_rollback</function>.
</para>
</simpara>
<programlisting role="php">
<![CDATA[
<?php

View File

@@ -12,9 +12,9 @@
<methodparam><type>string</type><parameter>setting</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Changes the driver error handling and logging configurations.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -23,10 +23,10 @@
<varlistentry>
<term><parameter>setting</parameter></term>
<listitem>
<para>
<simpara>
The name of the setting to set. The possible values are
"WarningsReturnAsErrors", "LogSubsystems", and "LogSeverity".
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
@@ -75,9 +75,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
&return.success;
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">

View File

@@ -12,11 +12,11 @@
<methodparam><type>string</type><parameter>serverName</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>connectionInfo</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Opens a connection to a Microsoft SQL Server database. By default, the connection
is attempted using Windows Authentication. To connect using SQL Server
Authentication, include "UID" and "PWD" in the connection options array.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -25,22 +25,22 @@
<varlistentry>
<term><parameter>serverName</parameter></term>
<listitem>
<para>
<simpara>
The name of the server to which a connection is established. To connect
to a specific instance, follow the server name with a backward slash
and the instance name (e.g. serverName\sqlexpress).
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>connectionInfo</parameter></term>
<listitem>
<para>
<simpara>
An associative array that specifies options for connecting to the server.
If values for the UID and PWD keys are not specified, the connection
will be attempted using Windows Authentication. For a complete list of supported
keys, see <link xlink:href="&url.sqlsrv.connection.options;">SQLSRV Connection Options</link>.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -48,9 +48,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
A connection resource. If a connection cannot be successfully opened, &false; is returned.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
@@ -119,20 +119,20 @@ if( $conn ) {
<refsect1 role="notes">
&reftitle.notes;
<para>
<simpara>
By default, the <function>sqlsrv_connect</function> uses connection pooling to
improve connection performance. To turn off connection pooling (i.e. force a
new connection on each call), set the "ConnectionPooling" option in the
$connectionOptions array to 0 (or &false;). For more information, see
<link xlink:href="&url.sqlsrv.connection.pooling;">SQLSRV Connection Pooling</link>.
</para>
<para>
</simpara>
<simpara>
The SQLSRV extension does not have a dedicated function for changing which
database is connected to. The target database is specified in the
$connectionOptions array that is passed to sqlsrv_connect. To change the
database on an open connection, execute the following query "USE dbName"
(e.g. sqlsrv_query($conn, "USE dbName")).
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">

View File

@@ -12,9 +12,9 @@
<type>mixed</type><methodname>sqlsrv_errors</methodname>
<methodparam choice="opt"><type>int</type><parameter>errorsOrWarnings</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Returns error and warning information about the last SQLSRV operation performed.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -23,12 +23,12 @@
<varlistentry>
<term><parameter>errorsOrWarnings</parameter></term>
<listitem>
<para>
<simpara>
Determines whether error information, warning information, or both are
returned. If this parameter is not supplied, both error information and
warning information are returned. The following are the supported values
for this parameter: SQLSRV_ERR_ALL, SQLSRV_ERR_ERRORS, SQLSRV_ERR_WARNINGS.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -113,14 +113,14 @@ if( $stmt === false ) {
<refsect1 role="notes">
&reftitle.notes;
<para>
<simpara>
By default, warnings generated on a call to any SQLSRV function are treated
as errors. This means that if a warning occurs on a call to a SQLSRV function,
the function returns &false;. However, warnings that correspond to SQLSTATE
values 01000, 01001, 01003, and 01S02 are never treated as errors. For
information about changing this behavior, see <function>sqlsrv_configure</function>
and the WarningsReturnAsErrors setting.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">

View File

@@ -11,11 +11,11 @@
<type>bool</type><methodname>sqlsrv_execute</methodname>
<methodparam><type>resource</type><parameter>stmt</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Executes a statement prepared with <function>sqlsrv_prepare</function>. This
function is ideal for executing a prepared statement multiple times with
different parameter values.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -24,9 +24,9 @@
<varlistentry>
<term><parameter>stmt</parameter></term>
<listitem>
<para>
<simpara>
A statement resource returned by <function>sqlsrv_prepare</function>.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -34,20 +34,20 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
&return.success;
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>sqlsrv_execute</function> example</title>
<para>
<simpara>
This example demonstrates how to prepare a statement with
<function>sqlsrv_prepare</function> and re-execute it multiple times (with
different parameter values) using <function>sqlsrv_execute</function>.
</para>
</simpara>
<programlisting role="php">
<![CDATA[
<?php
@@ -90,13 +90,13 @@ foreach( $orders as $id => $qty) {
<refsect1 role="notes">
&reftitle.notes;
<para>
<simpara>
When you prepare a statement that uses variables as parameters, the variables
are bound to the statement. This means that if you update the values of the
variables, the next time you execute the statement it will run with updated
parameter values. For statements that you plan to execute only once, use
<function>sqlsrv_query</function>.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">

View File

@@ -14,10 +14,10 @@
<methodparam choice="opt"><type>int</type><parameter>row</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Returns the next available row of data as an associative array, a numeric
array, or both (the default).
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -26,48 +26,48 @@
<varlistentry>
<term><parameter>stmt</parameter></term>
<listitem>
<para>
<simpara>
A statement resource returned by sqlsrv_query or sqlsrv_prepare.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>fetchType</parameter></term>
<listitem>
<para>
<simpara>
A predefined constant specifying the type of array to return. Possible
values are <constant>SQLSRV_FETCH_ASSOC</constant>,
<constant>SQLSRV_FETCH_NUMERIC</constant>, and
<constant>SQLSRV_FETCH_BOTH</constant> (the default).
</para>
<para>
</simpara>
<simpara>
A fetch type of SQLSRV_FETCH_ASSOC should not be used when consuming a
result set with multiple columns of the same name.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>row</parameter></term>
<listitem>
<para>
<simpara>
Specifies the row to access in a result set that uses a scrollable cursor.
Possible values are <constant>SQLSRV_SCROLL_NEXT</constant>,
<constant>SQLSRV_SCROLL_PRIOR</constant>, <constant>SQLSRV_SCROLL_FIRST</constant>,
<constant>SQLSRV_SCROLL_LAST</constant>, <constant>SQLSRV_SCROLL_ABSOLUTE</constant> and,
<constant>SQLSRV_SCROLL_RELATIVE</constant> (the default). When this parameter
is specified, the <parameter>fetchType</parameter> must be explicitly defined.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>offset</parameter></term>
<listitem>
<para>
<simpara>
Specifies the row to be accessed if the row parameter is set to
<constant>SQLSRV_SCROLL_ABSOLUTE</constant> or
<constant>SQLSRV_SCROLL_RELATIVE</constant>. Note that the first row in
a result set has index 0.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -75,10 +75,10 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns an array on success, &null; if there are no more rows to return, and
&false; if an error occurs.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
@@ -141,19 +141,19 @@ sqlsrv_free_stmt( $stmt);
<refsect1 role="notes">
&reftitle.notes;
<para>
<simpara>
Not specifying the <parameter>fetchType</parameter> or explicitly using the
<constant>SQLSRV_FETCH_TYPE</constant> constant in the examples above will
return an array that has both associative and numeric keys.
</para>
<para>
</simpara>
<simpara>
If more than one column is returned with the same name, the last column will
take precedence. To avoid field name collisions, use aliases.
</para>
<para>
</simpara>
<simpara>
If a column with no name is returned, the associative key for the array element
will be an empty string ("").
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">

View File

@@ -15,11 +15,11 @@
<methodparam choice="opt"><type>int</type><parameter>row</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Retrieves the next row of data in a result set as an instance of the specified
class with properties that match the row field names and values that correspond
to the row field values.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -28,29 +28,29 @@
<varlistentry>
<term><parameter>stmt</parameter></term>
<listitem>
<para>
<simpara>
A statement resource created by <function>sqlsrv_query</function> or
<function>sqlsrv_execute</function>.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>className</parameter></term>
<listitem>
<para>
<simpara>
The name of the class to instantiate. If no class name is specified,
stdClass is instantiated.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ctorParams</parameter></term>
<listitem>
<para>
<simpara>
Values passed to the constructor of the specified class. If the constructor
of the specified class takes parameters, the ctorParams array must be
supplied.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
@@ -74,12 +74,12 @@
<varlistentry>
<term><parameter>offset</parameter></term>
<listitem>
<para>
<simpara>
Specifies the row to be accessed if the row parameter is set to
<constant>SQLSRV_SCROLL_ABSOLUTE</constant> or
<constant>SQLSRV_SCROLL_RELATIVE</constant>. Note that the first row in
a result set has index 0.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -87,19 +87,19 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns an object on success, &null; if there are no more rows to return,
and &false; if an error occurs or if the specified class does not exist.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>sqlsrv_fetch_object</function> example</title>
<para>
<simpara>
The following example demonstrates how to retrieve a row as a stdClass object.
</para>
</simpara>
<programlisting role="php">
<![CDATA[
<?php
@@ -147,11 +147,11 @@ while( $obj = sqlsrv_fetch_object( $stmt)) {
name is returned, the field value will be ignored and a warning will be added
to the error collection.
</para>
<para>
<simpara>
When consuming a result set that has multiple columns with the same name, it may
be better to use <function>sqlsrv_fetch_array</function> or the combination of
<function>sqlsrv_fetch</function> and <function>sqlsrv_get_field</function>.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">

View File

@@ -14,10 +14,10 @@
<methodparam choice="opt"><type>int</type><parameter>row</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Makes the next row in a result set available for reading. Use
<function>sqlsrv_get_field</function> to read the fields of the row.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -26,10 +26,10 @@
<varlistentry>
<term><parameter>stmt</parameter></term>
<listitem>
<para>
<simpara>
A statement resource created by executing <function>sqlsrv_query</function>
or <function>sqlsrv_execute</function>.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
@@ -53,12 +53,12 @@
<varlistentry>
<term><parameter>offset</parameter></term>
<listitem>
<para>
<simpara>
Specifies the row to be accessed if the row parameter is set to
<constant>SQLSRV_SCROLL_ABSOLUTE</constant> or
<constant>SQLSRV_SCROLL_RELATIVE</constant>. Note that the first row in
a result set has index 0.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -66,21 +66,21 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns &true; if the next row of a result set was successfully retrieved,
&false; if an error occurs, and &null; if there are no more rows in the result set.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>sqlsrv_fetch</function> example</title>
<para>
<simpara>
The following example demonstrates how to retrieve a row with
<function>sqlsrv_fetch</function> and get the row fields with
<function>sqlsrv_get_field</function>.
</para>
</simpara>
<programlisting role="php">
<![CDATA[
<?php

View File

@@ -13,12 +13,12 @@
<type>mixed</type><methodname>sqlsrv_field_metadata</methodname>
<methodparam><type>resource</type><parameter>stmt</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Retrieves metadata for the fields of a statement prepared by
<function>sqlsrv_prepare</function> or <function>sqlsrv_query</function>.
<function>sqlsrv_field_metadata</function> can be called on a statement before
or after statement execution.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -27,9 +27,9 @@
<varlistentry>
<term><parameter>stmt</parameter></term>
<listitem>
<para>
<simpara>
The statement resource for which metadata is returned.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>

View File

@@ -11,13 +11,13 @@
<type>bool</type><methodname>sqlsrv_free_stmt</methodname>
<methodparam><type>resource</type><parameter>stmt</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Frees all resources for the specified statement. The statement cannot be used
after <function>sqlsrv_free_stmt</function> has been called on it. If
<function>sqlsrv_free_stmt</function> is called on an in-progress statement
that alters server state, statement execution is terminated and the statement
is rolled back.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -26,11 +26,11 @@
<varlistentry>
<term><parameter>stmt</parameter></term>
<listitem>
<para>
<simpara>
The statement for which resources are freed.
Note that &null; is a valid parameter value. This allows the function to be
called multiple times in a script.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -38,9 +38,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
&return.success;
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
@@ -77,13 +77,13 @@ sqlsrv_free_stmt( $stmt);
<refsect1 role="notes">
&reftitle.notes;
<para>
<simpara>
The main difference between <function>sqlsrv_free_stmt</function> and
<function>sqlsrv_cancel</function> is that a statement resource cancelled with
<function>sqlsrv_cancel</function> can be re-executed if it was created with
<function>sqlsrv_prepare</function>. A statement resource cancelled with
<function>sqlsrv_free_statement</function> cannot be re-executed.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;

View File

@@ -11,9 +11,9 @@
<type>mixed</type><methodname>sqlsrv_get_config</methodname>
<methodparam><type>string</type><parameter>setting</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Returns the value of the specified configuration setting.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -22,10 +22,10 @@
<varlistentry>
<term><parameter>setting</parameter></term>
<listitem>
<para>
<simpara>
The name of the setting for which the value is returned. For a list of
configurable settings, see <function>sqlsrv_configure</function>.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -33,10 +33,10 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns the value of the specified setting. If an invalid setting is specified,
&false; is returned.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">

View File

@@ -13,10 +13,10 @@
<methodparam><type>int</type><parameter>fieldIndex</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>getAsType</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Gets field data from the currently selected row. Fields must be accessed in
order. Field indices start at 0.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -25,32 +25,32 @@
<varlistentry>
<term><parameter>stmt</parameter></term>
<listitem>
<para>
<simpara>
A statement resource returned by <function>sqlsrv_query</function> or
<function>sqlsrv_execute</function>.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>fieldIndex</parameter></term>
<listitem>
<para>
<simpara>
The index of the field to be retrieved. Field indices start at 0. Fields
must be accessed in order. i.e. If you access field index 1, then field
index 0 will not be available.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>getAsType</parameter></term>
<listitem>
<para>
<simpara>
The PHP data type for the returned field data. If this parameter is not
set, the field data will be returned as its default PHP data type.
For information about default PHP data types, see
<link xlink:href="&url.sqlsrv.default.phptypes;">Default PHP Data Types</link>
in the Microsoft SQLSRV documentation.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -58,20 +58,20 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns data from the specified field on success. Returns &false; otherwise.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>sqlsrv_get_field</function> example</title>
<para>
<simpara>
The following example demonstrates how to retrieve a row with
<function>sqlsrv_fetch</function> and get the row fields with
<function>sqlsrv_get_field</function>.
</para>
</simpara>
<programlisting role="php">
<![CDATA[
<?php

View File

@@ -11,9 +11,9 @@
<type>bool</type><methodname>sqlsrv_has_rows</methodname>
<methodparam><type>resource</type><parameter>stmt</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Indicates whether the specified statement has rows.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -22,10 +22,10 @@
<varlistentry>
<term><parameter>stmt</parameter></term>
<listitem>
<para>
<simpara>
A statement resource returned by <function>sqlsrv_query</function> or
<function>sqlsrv_execute</function>.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -33,10 +33,10 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns &true; if the specified statement has rows and &false; if the statement
does not have rows or if an error occurred.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">

View File

@@ -12,10 +12,10 @@
<!-- Example: Required parameter -->
<methodparam><type>resource</type><parameter>stmt</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Makes the next result of the specified statement active. Results include result
sets, row counts, and output parameters.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -24,9 +24,9 @@
<varlistentry>
<term><parameter>stmt</parameter></term>
<listitem>
<para>
<simpara>
The statement on which the next result is being called.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -34,23 +34,23 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns &true; if the next result was successfully retrieved, &false; if an error
occurred, and &null; if there are no more results to retrieve.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>sqlsrv_next_result</function> example</title>
<para>
<simpara>
The following example executes a batch query that inserts into a table and
then selects from the table. This produces two results on the statement:
one for the rows affected by the INSERT and one for the rows returned by
the SELECT. To get to the rows returned by the SELECT,
<function>sqlsrv_next_result</function> must be called to move past the first result.
</para>
</simpara>
<programlisting role="php">
<![CDATA[
<?php

View File

@@ -11,9 +11,9 @@
<type>mixed</type><methodname>sqlsrv_num_fields</methodname>
<methodparam><type>resource</type><parameter>stmt</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Retrieves the number of fields (columns) on a statement.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -22,11 +22,11 @@
<varlistentry>
<term><parameter>stmt</parameter></term>
<listitem>
<para>
<simpara>
The statement for which the number of fields is returned.
<function>sqlsrv_num_fields</function> can be called on a statement before
or after statement execution.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -34,9 +34,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns the number of fields on success. Returns &false; otherwise.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">

View File

@@ -11,13 +11,13 @@
<type>mixed</type><methodname>sqlsrv_num_rows</methodname>
<methodparam><type>resource</type><parameter>stmt</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Retrieves the number of rows in a result set. This function requires that the
statement resource be created with a static or keyset cursor. For more information,
see <function>sqlsrv_query</function>, <function>sqlsrv_prepare</function>,
or <link xlink:href="&url.sqlsrv.specify.cursortype;">Specifying a Cursor Type and Selecting Rows</link>
in the Microsoft SQLSRV documentation.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -26,13 +26,13 @@
<varlistentry>
<term><parameter>stmt</parameter></term>
<listitem>
<para>
<simpara>
The statement for which the row count is returned. The statement resource
must be created with a static or keyset cursor. For more information, see
<function>sqlsrv_query</function>, <function>sqlsrv_prepare</function>, or
<link xlink:href="&url.sqlsrv.specify.cursortype;">Specifying a Cursor Type and Selecting Rows</link>
in the Microsoft SQLSRV documentation.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -40,10 +40,10 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns the number of rows retrieved on success and &false; if an error occurred.
If a forward cursor (the default) or dynamic cursor is used, &false; is returned.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">

View File

@@ -14,10 +14,10 @@
<methodparam choice="opt"><type>array</type><parameter>params</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>options</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Prepares a query for execution. This function is ideal for preparing a query
that will be executed multiple times with different parameter values.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -26,17 +26,17 @@
<varlistentry>
<term><parameter>conn</parameter></term>
<listitem>
<para>
<simpara>
A connection resource returned by <function>sqlsrv_connect</function>.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>sql</parameter></term>
<listitem>
<para>
<simpara>
The string that defines the query to be prepared and executed.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
@@ -91,10 +91,10 @@
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
<simpara>
An array specifying query property options. The supported keys are described
in the following table:
</para>
</simpara>
<table>
<title>Query Options</title>
<tgroup cols="3">
@@ -136,19 +136,19 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns a statement resource on success and &false; if an error occurred.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>sqlsrv_prepare</function> example</title>
<para>
<simpara>
This example demonstrates how to prepare a statement with <function>sqlsrv_prepare</function>
and re-execute it multiple times (with different parameter values) using <function>sqlsrv_execute</function>.
</para>
</simpara>
<programlisting role="php">
<![CDATA[
<?php
@@ -191,13 +191,13 @@ foreach( $orders as $id => $qty) {
<refsect1 role="notes">
&reftitle.notes;
<para>
<simpara>
When you prepare a statement that uses variables as parameters, the variables
are bound to the statement. This means that if you update the values of the
variables, the next time you execute the statement it will run with updated
parameter values. For statements that you plan to execute only once, use
<function>sqlsrv_query</function>.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">

View File

@@ -14,9 +14,9 @@
<methodparam choice="opt"><type>array</type><parameter>params</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>options</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Prepares and executes a query.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -25,17 +25,17 @@
<varlistentry>
<term><parameter>conn</parameter></term>
<listitem>
<para>
<simpara>
A connection resource returned by <function>sqlsrv_connect</function>.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>sql</parameter></term>
<listitem>
<para>
<simpara>
The string that defines the query to be prepared and executed.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
@@ -90,10 +90,10 @@
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
<simpara>
An array specifying query property options. The supported keys are described
in the following table:
</para>
</simpara>
<table>
<title>Query Options</title>
<tgroup cols="3">
@@ -135,9 +135,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns a statement resource on success and &false; if an error occurred.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
@@ -169,11 +169,11 @@ if( $stmt === false ) {
<refsect1 role="notes">
&reftitle.notes;
<para>
<simpara>
For statements that you plan to execute only once, use <function>sqlsrv_query</function>.
If you intend to re-execute a statement with different parameter values, use
the combination of <function>sqlsrv_prepare</function> and <function>sqlsrv_execute</function>.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">

View File

@@ -12,10 +12,10 @@
<type>bool</type><methodname>sqlsrv_rollback</methodname>
<methodparam><type>resource</type><parameter>conn</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Rolls back a transaction that was begun with <function>sqlsrv_begin_transaction</function>
and returns the connection to auto-commit mode.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -24,9 +24,9 @@
<varlistentry>
<term><parameter>conn</parameter></term>
<listitem>
<para>
<simpara>
The connection resource returned by a call to <function>sqlsrv_connect</function>.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -34,19 +34,19 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
&return.success;
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>sqlsrv_rollback</function> example</title>
<para>
<simpara>
The following example demonstrates how to use <function>sqlsrv_begin_transaction</function>
together with <function>sqlsrv_commit</function> and <function>sqlsrv_rollback</function>.
</para>
</simpara>
<programlisting role="php">
<![CDATA[
<?php

View File

@@ -12,11 +12,11 @@
<type class="union"><type>int</type><type>false</type></type><methodname>sqlsrv_rows_affected</methodname>
<methodparam><type>resource</type><parameter>stmt</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Returns the number of rows modified by the last INSERT, UPDATE, or DELETE
query executed. For information about the number of rows returned by a SELECT
query, see <function>sqlsrv_num_rows</function>.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -25,9 +25,9 @@
<varlistentry>
<term><parameter>stmt</parameter></term>
<listitem>
<para>
<simpara>
The executed statement resource for which the number of affected rows is returned.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -35,11 +35,11 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns the number of rows affected by the last INSERT, UPDATE, or DELETE query.
If no rows were affected, 0 is returned. If the number of affected rows cannot
be determined, -1 is returned. If an error occurred, &false; is returned.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">

View File

@@ -11,10 +11,10 @@
<type>bool</type><methodname>sqlsrv_send_stream_data</methodname>
<methodparam><type>resource</type><parameter>stmt</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Send data from parameter streams to the server. Up to 8 KB of data is sent
with each call.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -23,10 +23,10 @@
<varlistentry>
<term><parameter>stmt</parameter></term>
<listitem>
<para>
<simpara>
A statement resource returned by <function>sqlsrv_query</function> or
<function>sqlsrv_execute</function>.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -34,9 +34,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns &true; if there is more data to send and &false; if there is not.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">

View File

@@ -11,9 +11,9 @@
<type>array</type><methodname>sqlsrv_server_info</methodname>
<methodparam><type>resource</type><parameter>conn</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Returns information about the server.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -22,9 +22,9 @@
<varlistentry>
<term><parameter>conn</parameter></term>
<listitem>
<para>
<simpara>
The connection resource that connects the client and the server.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>

View File

@@ -3,9 +3,9 @@
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sqlsrv.configuration">
&reftitle.runtime;
&extension.runtime;
<para>The following table lists the configuration options available in the SQLSRV
<simpara>The following table lists the configuration options available in the SQLSRV
extension. For more information about these options, see
<link xlink:href="&url.sqlsrv.error.handling;">Handling SQLSRV Warnings and Errors</link>.</para>
<link xlink:href="&url.sqlsrv.error.handling;">Handling SQLSRV Warnings and Errors</link>.</simpara>
<table>
<title>SQLSRV &ConfigureOptions;</title>
<tgroup cols="4">

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<chapter xml:id="sqlsrv.setup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sqlsrv.setup">
&reftitle.setup;
<!-- {{{ Requirements -->
@@ -17,26 +16,26 @@
</simplelist>
</para>
<para>
The SQLSRV extension requires that the Microsoft SQL Server 2012 Native
Client be installed on the same computer that is running PHP. If the Microsoft
SQL Server 2012 Native Client is not already installed, click the appropriate link below
The SQLSRV extension requires that the Microsoft SQL Server 2012 Native
Client be installed on the same computer that is running PHP. If the Microsoft
SQL Server 2012 Native Client is not already installed, click the appropriate link below
to download it:
<simplelist>
<member><link xlink:href="&url.sqlsrv.snac.x86download;">Download the x86 package</link></member>
<member><link xlink:href="&url.sqlsrv.snac.x64download;">Download the x64 package</link></member>
</simplelist>
</para>
<para>
<simpara>
The SQLSRV download comes 8 driver files, four of which are for PDO support.
</para>
<para>
</simpara>
<simpara>
The most recent version of the driver is available for download here:
<link xlink:href="&url.sqlsrv;">SQLSRV download</link>.
</para>
<para>
For more information about SQLSRV requirements, see
</simpara>
<simpara>
For more information about SQLSRV requirements, see
<link xlink:href="&url.sqlsrv.system.requirements;">SQLSRV System Requirements</link>.
</para>
</simpara>
</section>
<!-- }}} -->
@@ -53,22 +52,21 @@
&reftitle.resources;
<section xml:id="sqlsrv.resources.link">
<title>Connection resource</title>
<para>
<simpara>
A connection resource returned by <function>sqlsrv_connect</function>.
</para>
</simpara>
</section>
<section xml:id="sqlsrv.resources.statement">
<title>Statement resource</title>
<para>
A statement resource returned by <function>sqlsrv_query</function> or by
<simpara>
A statement resource returned by <function>sqlsrv_query</function> or by
<function>sqlsrv_prepare</function>.
</para>
</simpara>
</section>
</section>
<!-- }}} -->
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
@@ -89,4 +87,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->