Contributions are ready for review

From: Date: Mon, 09 Dec 2013 13:00:03 +0000
Subject: Contributions are ready for review
Groups: php.doc.ja 
Request: Send a blank email to doc-ja+get-4119@lists.php.net to get a copy of this message
Hello PHP JA Documentation team, There are contributions within the online editor queue for this language. Please review, then commit or delete these patches. Patches for review : ----------------------- New file: ja/reference/sqlsrv/functions/sqlsrv-fetch-array.xml By: anonymous on 2013-12-05 14:09:49 =================================================================== --- ja/reference/sqlsrv/functions/sqlsrv-fetch-array.xml +++ ja/reference/sqlsrv/functions/sqlsrv-fetch-array.xml @@ -0,0 +1,198 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: $ --> +<!-- EN-Revision: 326727 Maintainer: anonymous #36707 Status: ready --> +<!-- Reviewed: no --> + +<refentry xml:id="function.sqlsrv-fetch-array" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> + <refnamediv> + <refname>sqlsrv_fetch_array</refname> + <refpurpose>Returns a row as an array</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>array</type><methodname>sqlsrv_fetch_array</methodname> + <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>fetchType</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>row</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam> + </methodsynopsis> + <para> + クエリ結果から列データを順に返します。列データの型は連想配列、配列、またはその両方(デフォルト)を選択できます。 + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>stmt</parameter></term> + <listitem> + <para> + A statement resource returned by sqlsrv_query or sqlsrv_execute. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>fetchType</parameter></term> + <listitem> + <para> + 返り値の型を指定します。連想配列<constant>SQLSRV_FETCH_ASSOC</constant>, + 配列<constant>SQLSRV_FETCH_NUMERIC</constant>, and + 連想配列と配列の両方<constant>SQLSRV_FETCH_BOTH</constant> (デフォルト) + のうち1つを指定します。 + </para> + <para> + SQLSRV_FETCH_ASSOC(連想配列)は同じ名前の列名が複数存在する結果セットを扱う際に使ってはならない。(連想配列のキーが重複するため) + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>row</parameter></term> + <listitem> + <para> + スクロール可能なカーソルを用いて、結果セットから取得する列を指定します。 + 定義済み定数は、 <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>(列番号の相対指定) (デフォルト値). + この引数を指定する場合は、<parameter>fetchType</parameter> を指定しなくてはなりません。 + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>offset</parameter></term> + <listitem> + <para> + 引数rowに + <constant>SQLSRV_SCROLL_ABSOLUTE</constant> または + <constant>SQLSRV_SCROLL_RELATIVE</constant> を指定する際に、この引数で取得する列を指定します。 + 列番号は0から始まります。 + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + 成功時に配列を返します。 返す列がない場合は&null; を返します。エラーが起きた場合は + &false;を返します。 + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>連想配列を扱う場合の例</title> + <programlisting role="php"> +<![CDATA[ +<?php +$serverName = "serverNameinstanceName"; +$connectionInfo = array( "Database"=>"dbName", "UID"=>"username", "PWD"=>"password"); +$conn = sqlsrv_connect( $serverName, $connectionInfo ); +if( $conn === false ) { + die( print_r( sqlsrv_errors(), true)); +} + +$sql = "SELECT FirstName, LastName FROM SomeTable"; +$stmt = sqlsrv_query( $conn, $sql ); +if( $stmt === false) { + die( print_r( sqlsrv_errors(), true) ); +} + +while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) { + echo $row['LastName'].", ".$row['FirstName']."<br />"; +} + +sqlsrv_free_stmt( $stmt); +?> +]]> + </programlisting> + </example> + </para> + <para> + <example> + <title>配列を扱う場合の例</title> + <programlisting role="php"> +<![CDATA[ +<?php +$serverName = "serverNameinstanceName"; +$connectionInfo = array( "Database"=>"dbName", "UID"=>"username", "PWD"=>"password"); +$conn = sqlsrv_connect( $serverName, $connectionInfo ); +if( $conn === false ) { + die( print_r( sqlsrv_errors(), true)); +} + +$sql = "SELECT FirstName, LastName FROM SomeTable"; +$stmt = sqlsrv_query( $conn, $sql ); +if( $stmt === false) { + die( print_r( sqlsrv_errors(), true) ); +} + +while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_NUMERIC) ) { + echo $row[0].", ".$row[1]."<br />"; +} + +sqlsrv_free_stmt( $stmt); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + <para> + Not specifying the <parameter>fetchType</parameter> or explicity 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> + 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> + If a column with no name is returned, the associative key for the array element + will be an empty string (""). + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>sqlsrv_connect</function></member> + <member><function>sqlsrv_query</function></member> + <member><function>sqlsrv_errors</function></member> + <member><function>sqlsrv_fetch</function></member> + </simplelist> + </para> + </refsect1> +</refentry> + +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +indent-tabs-mode:nil +sgml-parent-document:nil +sgml-default-dtd-file:"~/.phpdoc/manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=51274 => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=51274 ------------------------------------------------------------------ -- https://edit.php.net/ This email is send automatically by the Php Docbook Online Editor.

« previous php.doc.ja (#4119) next »