cvs: phpdoc /en/reference/mssql/functions mssql-bind.xml mssql-close.xml mssql-connect.xml mssql-guid-string.xml mssql-num-rows.xml mssql-query.xml
mssql-rows-affected.xml mssql-select-db.xml
| From: | Kalle Sommer Nielsen | Date: | Tue, 07 Oct 2008 02:34:39 +0000 |
| Subject: | cvs: phpdoc /en/reference/mssql/functions mssql-bind.xml mssql-close.xml mssql-connect.xml mssql-guid-string.xml mssql-num-rows.xml mssql-query.xml mssql-rows-affected.xml mssql-select-db.xml |
||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-2201@lists.php.net to get a copy of this message | ||
kalle Tue Oct 7 02:34:39 2008 UTC
Modified files:
/phpdoc/en/reference/mssql/functions mssql-bind.xml mssql-close.xml
mssql-connect.xml
mssql-guid-string.xml
mssql-num-rows.xml
mssql-query.xml
mssql-rows-affected.xml
mssql-select-db.xml
Log:
Part 1/2 of updates to MSSQL docs
- Documented the following functions
- mssql_rows_affected
- mssql_guid_string
- Added examples for the following functions
- mssql_close
- mssql_connect
- mssql_num_rows
- mssql_query
- mssql_rows_affected
- mssql_select_db
- State that the following function parameter types has changed
- mssql_bind
- is_output and is_null is booleans
- mssql_guid_string
- short_Format is boolean
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-bind.xml?r1=1.13&r2=1.14&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-bind.xml diff -u phpdoc/en/reference/mssql/functions/mssql-bind.xml:1.13 phpdoc/en/reference/mssql/functions/mssql-bind.xml:1.14 --- phpdoc/en/reference/mssql/functions/mssql-bind.xml:1.13 Tue Aug 7 08:06:59 2007 +++ phpdoc/en/reference/mssql/functions/mssql-bind.xml Tue Oct 7 02:34:38 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.13 $ --> +<!-- $Revision: 1.14 $ --> <refentry xml:id='function.mssql-bind' xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mssql_bind</refname> @@ -14,8 +14,8 @@ <methodparam><type>string</type><parameter>param_name</parameter></methodparam> <methodparam><type>mixed</type><parameter role="reference">var</parameter></methodparam> <methodparam><type>int</type><parameter>type</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>is_output</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>is_null</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>is_output</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>is_null</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>maxlen</parameter></methodparam> </methodsynopsis> <para> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-close.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-close.xml diff -u phpdoc/en/reference/mssql/functions/mssql-close.xml:1.7 phpdoc/en/reference/mssql/functions/mssql-close.xml:1.8 --- phpdoc/en/reference/mssql/functions/mssql-close.xml:1.7 Wed Jun 20 22:24:59 2007 +++ phpdoc/en/reference/mssql/functions/mssql-close.xml Tue Oct 7 02:34:38 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <refentry xml:id="function.mssql-close" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mssql_close</refname> @@ -52,6 +52,28 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>mssql_close</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Connect to MSSQL +$link = mssql_connect('KALLESPC\SQLEXPRESS', 'sa', 'phpfi'); + +// Do any related operations here + +// Close the link to MSSQL +mssql_close($link); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-connect.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-connect.xml diff -u phpdoc/en/reference/mssql/functions/mssql-connect.xml:1.9 phpdoc/en/reference/mssql/functions/mssql-connect.xml:1.10 --- phpdoc/en/reference/mssql/functions/mssql-connect.xml:1.9 Thu Aug 16 10:24:53 2007 +++ phpdoc/en/reference/mssql/functions/mssql-connect.xml Tue Oct 7 02:34:38 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> +<!-- $Revision: 1.10 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.mssql-connect"> <refnamediv> <refname>mssql_connect</refname> @@ -104,6 +104,30 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>mssql_connect</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Server in the this format: <computer>\<instance name> +$server = 'KALLESPC\SQLEXPRESS'; + +$link = mssql_connect($server, 'sa', 'phpfi'); + +if(!$link) +{ + die('Something went wrong while connecting to MSSQL'); +} +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-guid-string.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-guid-string.xml diff -u phpdoc/en/reference/mssql/functions/mssql-guid-string.xml:1.6 phpdoc/en/reference/mssql/functions/mssql-guid-string.xml:1.7 --- phpdoc/en/reference/mssql/functions/mssql-guid-string.xml:1.6 Wed Jun 20 22:24:59 2007 +++ phpdoc/en/reference/mssql/functions/mssql-guid-string.xml Tue Oct 7 02:34:38 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry xml:id='function.mssql-guid-string' xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mssql_guid_string</refname> @@ -11,15 +11,46 @@ <methodsynopsis> <type>string</type><methodname>mssql_guid_string</methodname> <methodparam><type>string</type><parameter>binary</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>short_format</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>short_format</parameter></methodparam> </methodsynopsis> + <para> + Converts a 16 byte binary GUID to a string. + </para> + </refsect1> - &warn.undocumented.func; + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>binary</parameter></term> + <listitem> + <para> + A 16 byte binary GUID. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>short_format</parameter></term> + <listitem> + <para> + ... + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns the converted string on success. + </para> </refsect1> </refentry> - +< <!-- Keep this comment at the end of the file Local variables: mode: sgml http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-num-rows.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-num-rows.xml diff -u phpdoc/en/reference/mssql/functions/mssql-num-rows.xml:1.9 phpdoc/en/reference/mssql/functions/mssql-num-rows.xml:1.10 --- phpdoc/en/reference/mssql/functions/mssql-num-rows.xml:1.9 Wed Jun 20 22:24:59 2007 +++ phpdoc/en/reference/mssql/functions/mssql-num-rows.xml Tue Oct 7 02:34:38 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> +<!-- $Revision: 1.10 $ --> <refentry xml:id="function.mssql-num-rows" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mssql_num_rows</refname> @@ -42,6 +42,32 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>mssql_num_rows</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Connect to MSSQL and select the database +$link = mssql_connect('KALLESPC\SQLEXPRESS', 'sa', 'phpfi'); +mssql_select_db('php'); + +// Select all our records from a table +$query = mssql_query('SELECT * FROM [php].[dbo].[persons]'); + +echo 'Total records in database: ' . mssql_num_rows($query); + +// Clean up +mssql_free_result($query); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-query.xml?r1=1.11&r2=1.12&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-query.xml diff -u phpdoc/en/reference/mssql/functions/mssql-query.xml:1.11 phpdoc/en/reference/mssql/functions/mssql-query.xml:1.12 --- phpdoc/en/reference/mssql/functions/mssql-query.xml:1.11 Mon Aug 20 13:45:31 2007 +++ phpdoc/en/reference/mssql/functions/mssql-query.xml Tue Oct 7 02:34:38 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <refentry xml:id="function.mssql-query" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mssql_query</refname> @@ -68,6 +68,34 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>mssql_query</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Connect to MSSQL +$link = mssql_connect('KALLESPC\SQLEXPRESS', 'sa', 'phpfi') or die('Unable to connect MSSQL'); +mssql_select_db('php', $link) or die('Unable to select database'); + +// Do a simple query, select the version of +// MSSQL and print it. +$version = mssql_query('SELECT @@VERSION'); +$row = mssql_fetch_array($version); + +echo $row[0]; + +// Clean up +mssql_free_result($version); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="notes"> &reftitle.notes; <note> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-rows-affected.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-rows-affected.xml diff -u phpdoc/en/reference/mssql/functions/mssql-rows-affected.xml:1.6 phpdoc/en/reference/mssql/functions/mssql-rows-affected.xml:1.7 --- phpdoc/en/reference/mssql/functions/mssql-rows-affected.xml:1.6 Wed Jun 20 22:24:59 2007 +++ phpdoc/en/reference/mssql/functions/mssql-rows-affected.xml Tue Oct 7 02:34:38 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry xml:id='function.mssql-rows-affected' xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mssql_rows_affected</refname> @@ -12,9 +12,9 @@ <type>int</type><methodname>mssql_rows_affected</methodname> <methodparam><type>resource</type><parameter>link_identifier</parameter></methodparam> </methodsynopsis> - - &warn.undocumented.func; - + <para> + Returns the number of records affected by the last write query. + </para> </refsect1> <refsect1 role="parameters"> @@ -35,6 +35,32 @@ </para> </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns the number of records affected by last operation. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>mssql_rows_affected</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php´ +// Delete all rows in a table +mssql_query('TRUNCATE TABLE [php].[dbo].[persons]'); + +echo 'Deleted ' . mssql_affected_rows($link) . ' row(s)'; +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-select-db.xml?r1=1.10&r2=1.11&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-select-db.xml diff -u phpdoc/en/reference/mssql/functions/mssql-select-db.xml:1.10 phpdoc/en/reference/mssql/functions/mssql-select-db.xml:1.11 --- phpdoc/en/reference/mssql/functions/mssql-select-db.xml:1.10 Wed Jun 20 22:24:59 2007 +++ phpdoc/en/reference/mssql/functions/mssql-select-db.xml Tue Oct 7 02:34:38 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> +<!-- $Revision: 1.11 $ --> <refentry xml:id="function.mssql-select-db" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mssql_select_db</refname> @@ -77,8 +77,11 @@ <programlisting role="php"> <![CDATA[ <?php -$conn = mssql_connect('MYSQLSERVER', 'sa', 'password'); -mssql_select_db('[my data-base]', $conn); +// Create a link to MSSQL +$link = mssql_connect('KALLESPC\SQLEXPRESS', 'sa', 'phpfi'); + +// Select the database 'php' +mssql_select_db('php', $link); ?> ]]> </programlisting>
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-bind.xml?r1=1.13&r2=1.14&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-bind.xml diff -u phpdoc/en/reference/mssql/functions/mssql-bind.xml:1.13 phpdoc/en/reference/mssql/functions/mssql-bind.xml:1.14 --- phpdoc/en/reference/mssql/functions/mssql-bind.xml:1.13 Tue Aug 7 08:06:59 2007 +++ phpdoc/en/reference/mssql/functions/mssql-bind.xml Tue Oct 7 02:34:38 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.13 $ --> +<!-- $Revision: 1.14 $ --> <refentry xml:id='function.mssql-bind' xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mssql_bind</refname> @@ -14,8 +14,8 @@ <methodparam><type>string</type><parameter>param_name</parameter></methodparam> <methodparam><type>mixed</type><parameter role="reference">var</parameter></methodparam> <methodparam><type>int</type><parameter>type</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>is_output</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>is_null</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>is_output</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>is_null</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>maxlen</parameter></methodparam> </methodsynopsis> <para> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-close.xml?r1=1.7&r2=1.8&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-close.xml diff -u phpdoc/en/reference/mssql/functions/mssql-close.xml:1.7 phpdoc/en/reference/mssql/functions/mssql-close.xml:1.8 --- phpdoc/en/reference/mssql/functions/mssql-close.xml:1.7 Wed Jun 20 22:24:59 2007 +++ phpdoc/en/reference/mssql/functions/mssql-close.xml Tue Oct 7 02:34:38 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <refentry xml:id="function.mssql-close" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mssql_close</refname> @@ -52,6 +52,28 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>mssql_close</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Connect to MSSQL +$link = mssql_connect('KALLESPC\SQLEXPRESS', 'sa', 'phpfi'); + +// Do any related operations here + +// Close the link to MSSQL +mssql_close($link); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-connect.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-connect.xml diff -u phpdoc/en/reference/mssql/functions/mssql-connect.xml:1.9 phpdoc/en/reference/mssql/functions/mssql-connect.xml:1.10 --- phpdoc/en/reference/mssql/functions/mssql-connect.xml:1.9 Thu Aug 16 10:24:53 2007 +++ phpdoc/en/reference/mssql/functions/mssql-connect.xml Tue Oct 7 02:34:38 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> +<!-- $Revision: 1.10 $ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.mssql-connect"> <refnamediv> <refname>mssql_connect</refname> @@ -104,6 +104,30 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>mssql_connect</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Server in the this format: <computer>\<instance name> +$server = 'KALLESPC\SQLEXPRESS'; + +$link = mssql_connect($server, 'sa', 'phpfi'); + +if(!$link) +{ + die('Something went wrong while connecting to MSSQL'); +} +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-guid-string.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-guid-string.xml diff -u phpdoc/en/reference/mssql/functions/mssql-guid-string.xml:1.6 phpdoc/en/reference/mssql/functions/mssql-guid-string.xml:1.7 --- phpdoc/en/reference/mssql/functions/mssql-guid-string.xml:1.6 Wed Jun 20 22:24:59 2007 +++ phpdoc/en/reference/mssql/functions/mssql-guid-string.xml Tue Oct 7 02:34:38 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry xml:id='function.mssql-guid-string' xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mssql_guid_string</refname> @@ -11,15 +11,46 @@ <methodsynopsis> <type>string</type><methodname>mssql_guid_string</methodname> <methodparam><type>string</type><parameter>binary</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>short_format</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>short_format</parameter></methodparam> </methodsynopsis> + <para> + Converts a 16 byte binary GUID to a string. + </para> + </refsect1> - &warn.undocumented.func; + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>binary</parameter></term> + <listitem> + <para> + A 16 byte binary GUID. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>short_format</parameter></term> + <listitem> + <para> + ... + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns the converted string on success. + </para> </refsect1> </refentry> - +< <!-- Keep this comment at the end of the file Local variables: mode: sgml http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-num-rows.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-num-rows.xml diff -u phpdoc/en/reference/mssql/functions/mssql-num-rows.xml:1.9 phpdoc/en/reference/mssql/functions/mssql-num-rows.xml:1.10 --- phpdoc/en/reference/mssql/functions/mssql-num-rows.xml:1.9 Wed Jun 20 22:24:59 2007 +++ phpdoc/en/reference/mssql/functions/mssql-num-rows.xml Tue Oct 7 02:34:38 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> +<!-- $Revision: 1.10 $ --> <refentry xml:id="function.mssql-num-rows" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mssql_num_rows</refname> @@ -42,6 +42,32 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>mssql_num_rows</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Connect to MSSQL and select the database +$link = mssql_connect('KALLESPC\SQLEXPRESS', 'sa', 'phpfi'); +mssql_select_db('php'); + +// Select all our records from a table +$query = mssql_query('SELECT * FROM [php].[dbo].[persons]'); + +echo 'Total records in database: ' . mssql_num_rows($query); + +// Clean up +mssql_free_result($query); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-query.xml?r1=1.11&r2=1.12&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-query.xml diff -u phpdoc/en/reference/mssql/functions/mssql-query.xml:1.11 phpdoc/en/reference/mssql/functions/mssql-query.xml:1.12 --- phpdoc/en/reference/mssql/functions/mssql-query.xml:1.11 Mon Aug 20 13:45:31 2007 +++ phpdoc/en/reference/mssql/functions/mssql-query.xml Tue Oct 7 02:34:38 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <refentry xml:id="function.mssql-query" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mssql_query</refname> @@ -68,6 +68,34 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>mssql_query</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Connect to MSSQL +$link = mssql_connect('KALLESPC\SQLEXPRESS', 'sa', 'phpfi') or die('Unable to connect MSSQL'); +mssql_select_db('php', $link) or die('Unable to select database'); + +// Do a simple query, select the version of +// MSSQL and print it. +$version = mssql_query('SELECT @@VERSION'); +$row = mssql_fetch_array($version); + +echo $row[0]; + +// Clean up +mssql_free_result($version); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="notes"> &reftitle.notes; <note> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-rows-affected.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-rows-affected.xml diff -u phpdoc/en/reference/mssql/functions/mssql-rows-affected.xml:1.6 phpdoc/en/reference/mssql/functions/mssql-rows-affected.xml:1.7 --- phpdoc/en/reference/mssql/functions/mssql-rows-affected.xml:1.6 Wed Jun 20 22:24:59 2007 +++ phpdoc/en/reference/mssql/functions/mssql-rows-affected.xml Tue Oct 7 02:34:38 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry xml:id='function.mssql-rows-affected' xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mssql_rows_affected</refname> @@ -12,9 +12,9 @@ <type>int</type><methodname>mssql_rows_affected</methodname> <methodparam><type>resource</type><parameter>link_identifier</parameter></methodparam> </methodsynopsis> - - &warn.undocumented.func; - + <para> + Returns the number of records affected by the last write query. + </para> </refsect1> <refsect1 role="parameters"> @@ -35,6 +35,32 @@ </para> </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns the number of records affected by last operation. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>mssql_rows_affected</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php´ +// Delete all rows in a table +mssql_query('TRUNCATE TABLE [php].[dbo].[persons]'); + +echo 'Deleted ' . mssql_affected_rows($link) . ' row(s)'; +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/mssql/functions/mssql-select-db.xml?r1=1.10&r2=1.11&diff_format=u Index: phpdoc/en/reference/mssql/functions/mssql-select-db.xml diff -u phpdoc/en/reference/mssql/functions/mssql-select-db.xml:1.10 phpdoc/en/reference/mssql/functions/mssql-select-db.xml:1.11 --- phpdoc/en/reference/mssql/functions/mssql-select-db.xml:1.10 Wed Jun 20 22:24:59 2007 +++ phpdoc/en/reference/mssql/functions/mssql-select-db.xml Tue Oct 7 02:34:38 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> +<!-- $Revision: 1.11 $ --> <refentry xml:id="function.mssql-select-db" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>mssql_select_db</refname> @@ -77,8 +77,11 @@ <programlisting role="php"> <![CDATA[ <?php -$conn = mssql_connect('MYSQLSERVER', 'sa', 'password'); -mssql_select_db('[my data-base]', $conn); +// Create a link to MSSQL +$link = mssql_connect('KALLESPC\SQLEXPRESS', 'sa', 'phpfi'); + +// Select the database 'php' +mssql_select_db('php', $link); ?> ]]> </programlisting>