Sophie

Sophie

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

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_fetch_result</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_array"
HREF="function.sesam-fetch-array.html"><LINK
REL="NEXT"
TITLE="sesam_fetch_row"
HREF="function.sesam-fetch-row.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-array.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.sesam-fetch-row.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.sesam-fetch-result"
></A
>sesam_fetch_result</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN206706"
></A
><P
>    (PHP 3 CVS only)</P
>sesam_fetch_result&nbsp;--&nbsp;Return all or part of a query result</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN206709"
></A
><H2
>说明</H2
>mixed <B
CLASS="methodname"
>sesam_fetch_result</B
> ( string result_id [, int max_rows] )<BR
></BR
><P
>&#13;   Fetches a result, optionally limited to <CODE
CLASS="parameter"
>max_rows</CODE
>.
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN206722"
></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
><DT
><CODE
CLASS="parameter"
>max_rows</CODE
></DT
><DD
><P
>&#13;       Note that the amount of memory used up by a large query may be
       gigantic. Use the <CODE
CLASS="parameter"
>max_rows</CODE
> parameter to
       limit the maximum number of rows returned, unless you are
       absolutely sure that your result will not use up all available
       memory.
      </P
></DD
></DL
></DIV
>
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN206738"
></A
><H2
>返回值</H2
><P
>&#13;   Returns a mixed array with the query result entries, optionally
   limited to a maximum of <CODE
CLASS="parameter"
>max_rows</CODE
> rows.
   Note that both row and column indexes are zero-based.
   <DIV
CLASS="table"
><A
NAME="AEN206742"
></A
><P
><B
>表 1. 
     Mixed result set returned by <B
CLASS="function"
>sesam_fetch_result()</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;        number of columns in result set (or zero if this was an
        "immediate" query)
       </TD
></TR
><TR
><TD
>int $arr["rows"]</TD
><TD
>&#13;        number of rows in result set (between zero and
        <CODE
CLASS="parameter"
>max_rows</CODE
>)
       </TD
></TR
><TR
><TD
>bool $arr["truncated"]</TD
><TD
>&#13;        <TT
CLASS="constant"
><B
>TRUE</B
></TT
> if the number of rows was at least
        <CODE
CLASS="parameter"
>max_rows</CODE
>, <TT
CLASS="constant"
><B
>FALSE</B
></TT
>
        otherwise. Note that even when this is
        <TT
CLASS="constant"
><B
>TRUE</B
></TT
>, the next
        <B
CLASS="function"
>sesam_fetch_result()</B
> call may return zero
        rows because there are no more result entries.
       </TD
></TR
><TR
><TD
>mixed $arr[col][row]</TD
><TD
>&#13;        result data for all the fields at
        row(<TT
CLASS="literal"
>row</TT
>) and
        column(<TT
CLASS="literal"
>col</TT
>), (where the integer index
        <TT
CLASS="literal"
>row</TT
> is between 0 and
        <TT
CLASS="literal"
>$arr["rows"]-1</TT
>, and
        <TT
CLASS="literal"
>col</TT
> is between 0 and
        <TT
CLASS="literal"
>$arr["count"]-1</TT
>). Fields may be empty, so
        you must check for the existence of a field by using the php
        <A
HREF="function.isset.html"
><B
CLASS="function"
>isset()</B
></A
> function. The type of the
        returned fields depend on the respective SQL type declared
        for its column (see <A
HREF="ref.sesam.html"
>SESAM
        overview</A
> for the conversions applied). SESAM
        "multiple fields" are "inlined" and treated like a sequence
        of columns.
       </TD
></TR
></TBODY
></TABLE
></DIV
>
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN206777"
></A
><H2
>参见</H2
><P
>&#13;   <P
></P
><TABLE
BORDER="0"
><TBODY
><TR
><TD
><A
HREF="function.sesam-fetch-array.html"
><B
CLASS="function"
>sesam_fetch_array()</B
></A
></TD
></TR
><TR
><TD
><A
HREF="function.sesam-fetch-row.html"
><B
CLASS="function"
>sesam_fetch_row()</B
></A
></TD
></TR
><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-array.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-fetch-row.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>sesam_fetch_array</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_fetch_row</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>