Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 05cd670d8a02b2b4a0ffb1756f2e8308 > files > 9543

php-manual-zh-5.2.4-1mdv2008.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>sesam_field_array</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="PHP 手册"
HREF="index.html"><LINK
REL="UP"
TITLE="SESAM Database Functions"
HREF="ref.sesam.html"><LINK
REL="PREVIOUS"
TITLE="sesam_fetch_row"
HREF="function.sesam-fetch-row.html"><LINK
REL="NEXT"
TITLE="sesam_field_name"
HREF="function.sesam-field-name.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=UTF-8"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP 手册</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.sesam-fetch-row.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.sesam-field-name.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.sesam-field-array"
></A
>sesam_field_array</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN206910"
></A
><P
>    (PHP 3 CVS only)</P
>sesam_field_array&nbsp;--&nbsp;Return meta information about individual columns in a result</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN206913"
></A
><H2
>说明</H2
>array <B
CLASS="methodname"
>sesam_field_array</B
> ( string result_id )<BR
></BR
><P
>&#13;   Returns a mixed associative/indexed array with meta information (column
   name, type, precision, ...) about individual columns of the result after
   the query associated with <CODE
CLASS="parameter"
>result_id</CODE
>.
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN206923"
></A
><H2
>参数</H2
><P
>&#13;   <P
></P
><DIV
CLASS="variablelist"
><DL
><DT
><CODE
CLASS="parameter"
>result_id</CODE
></DT
><DD
><P
>&#13;       A valid result id returned by <A
HREF="function.sesam-query.html"
><B
CLASS="function"
>sesam_query()</B
></A
>.
      </P
></DD
></DL
></DIV
>
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN206933"
></A
><H2
>返回值</H2
><P
>&#13;   <DIV
CLASS="table"
><A
NAME="AEN206936"
></A
><P
><B
>表 1. 
     Mixed result set returned by <B
CLASS="function"
>sesam_field_array()</B
>
    </B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL><COL><THEAD
><TR
><TH
>Array Element</TH
><TH
>Contents</TH
></TR
></THEAD
><TBODY
><TR
><TD
>int $arr["count"]</TD
><TD
>&#13;        Total number of columns in result set (or zero if this was
        an "immediate" query).  SESAM "multiple fields" are
        "inlined" and treated like the respective number of columns.
       </TD
></TR
><TR
><TD
>string $arr[col]["name"]</TD
><TD
>&#13;        column name for column(<TT
CLASS="literal"
>col</TT
>), where
        <TT
CLASS="literal"
>col</TT
> is between 0 and
        <TT
CLASS="literal"
>$arr["count"]-1</TT
>. The returned value can
        be the empty string (for dynamically computed
        columns). SESAM "multiple fields" are "inlined" and treated
        like the respective number of columns, each with the same
        column name.
       </TD
></TR
><TR
><TD
>string $arr[col]["count"]</TD
><TD
>&#13;        The "count" attribute describes the repetition factor when
        the column has been declared as a "multiple field". Usually,
        the "count" attribute is 1. The first column of a "multiple
        field" column however contains the number of repetitions
        (the second and following column of the "multiple field"
        contain a "count" attribute of 1). This can be used to
        detect "multiple fields" in the result set. See the example
        shown in the <A
HREF="function.sesam-query.html"
><B
CLASS="function"
>sesam_query()</B
></A
> description
        for a sample use of the "count" attribute.
       </TD
></TR
><TR
><TD
>string $arr[col]["type"]</TD
><TD
>&#13;        PHP variable type of the data for
        column(<TT
CLASS="literal"
>col</TT
>), where <TT
CLASS="literal"
>col</TT
>
        is between 0 and <TT
CLASS="literal"
>$arr["count"]-1</TT
>. The
        returned value can be one of
         <P
></P
><UL
><LI
><P
><A
HREF="language.types.integer.html"
><B
CLASS="type"
>integer</B
></A
></P
></LI
><LI
><P
><A
HREF="language.types.float.html"
><B
CLASS="type"
>float</B
></A
></P
></LI
><LI
><P
><A
HREF="language.types.string.html"
><B
CLASS="type"
>string</B
></A
></P
></LI
></UL
>
        depending on the SQL type of the result.  SESAM "multiple
        fields" are "inlined" and treated like the respective number
        of columns, each with the same PHP type.
       </TD
></TR
><TR
><TD
>string $arr[col]["sqltype"]</TD
><TD
>&#13;        SQL variable type of the column data for
        column(<TT
CLASS="literal"
>col</TT
>), where <TT
CLASS="literal"
>col</TT
>
        is between 0 and <TT
CLASS="literal"
>$arr["count"]-1</TT
>. The
        returned value can be one of
         <P
></P
><UL
><LI
><P
>"CHARACTER"</P
></LI
><LI
><P
>"VARCHAR"</P
></LI
><LI
><P
>"NUMERIC"</P
></LI
><LI
><P
>"DECIMAL"</P
></LI
><LI
><P
>"INTEGER"</P
></LI
><LI
><P
>"SMALLINT"</P
></LI
><LI
><P
>"FLOAT"</P
></LI
><LI
><P
>"REAL"</P
></LI
><LI
><P
>"DOUBLE"</P
></LI
><LI
><P
>"DATE"</P
></LI
><LI
><P
>"TIME"</P
></LI
><LI
><P
>"TIMESTAMP"</P
></LI
></UL
>
        describing the SQL type of the result.  SESAM "multiple
        fields" are "inlined" and treated like the respective number
        of columns, each with the same SQL type.
       </TD
></TR
><TR
><TD
>string $arr[col]["length"]</TD
><TD
>&#13;        The SQL "length" attribute of the SQL variable in
        column(<TT
CLASS="literal"
>col</TT
>), where <TT
CLASS="literal"
>col</TT
>
        is between 0 and <TT
CLASS="literal"
>$arr["count"]-1</TT
>. The
        "length" attribute is used with "CHARACTER" and "VARCHAR"
        SQL types to specify the (maximum) length of the string
        variable.  SESAM "multiple fields" are "inlined" and treated
        like the respective number of columns, each with the same
        length attribute.
       </TD
></TR
><TR
><TD
>string $arr[col]["precision"]</TD
><TD
>&#13;        The "precision" attribute of the SQL variable in
        column(<TT
CLASS="literal"
>col</TT
>), where <TT
CLASS="literal"
>col</TT
>
        is between 0 and <TT
CLASS="literal"
>$arr["count"]-1</TT
>. The
        "precision" attribute is used with numeric and time data
        types.  SESAM "multiple fields" are "inlined" and treated
        like the respective number of columns, each with the same
        precision attribute.
       </TD
></TR
><TR
><TD
>string $arr[col]["scale"]</TD
><TD
>&#13;        The "scale" attribute of the SQL variable in
        column(<TT
CLASS="literal"
>col</TT
>), where <TT
CLASS="literal"
>col</TT
>
        is between 0 and <TT
CLASS="literal"
>$arr["count"]-1</TT
>. The
        "scale" attribute is used with numeric data types.  SESAM
        "multiple fields" are "inlined" and treated like the
        respective number of columns, each with the same scale
        attribute.
       </TD
></TR
></TBODY
></TABLE
></DIV
>
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN207023"
></A
><H2
>参见</H2
><P
>&#13;   <P
></P
><TABLE
BORDER="0"
><TBODY
><TR
><TD
><A
HREF="function.sesam-query.html"
><B
CLASS="function"
>sesam_query()</B
></A
></TD
></TR
></TBODY
></TABLE
><P
></P
>
  </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.sesam-fetch-row.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>起始页</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.sesam-field-name.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>sesam_fetch_row</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.sesam.html"
ACCESSKEY="U"
>上一级</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>sesam_field_name</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>