Sophie

Sophie

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

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
>db2_num_rows</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="PHP 手册"
HREF="index.html"><LINK
REL="UP"
TITLE="IBM DB2, Cloudscape and Apache Derby Functions"
HREF="ref.ibm-db2.html"><LINK
REL="PREVIOUS"
TITLE="db2_num_fields"
HREF="function.db2-num-fields.html"><LINK
REL="NEXT"
TITLE="db2_pconnect"
HREF="function.db2-pconnect.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.db2-num-fields.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.db2-pconnect.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.db2-num-rows"
></A
>db2_num_rows</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN81942"
></A
><P
>    (PECL)</P
>db2_num_rows&nbsp;--&nbsp;
   Returns the number of rows affected by an SQL statement
  </DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN81945"
></A
><H2
>说明</H2
>int <B
CLASS="methodname"
>db2_num_rows</B
> ( resource stmt )<BR
></BR
><P
>&#13;   Returns the number of rows deleted, inserted, or updated by an SQL
   statement.
  </P
><P
>&#13;   To determine the number of rows that will be returned by a SELECT
   statement, issue SELECT COUNT(*) with the same predicates as your
   intended SELECT statement and retrieve the value.
  </P
><P
>&#13;   If your application logic checks the number of rows returned by a SELECT
   statement and branches if the number of rows is 0, consider modifying your
   application to attempt to return the first row with one of
   <A
HREF="function.db2-fetch-assoc.html"
><B
CLASS="function"
>db2_fetch_assoc()</B
></A
>, <A
HREF="function.db2-fetch-both.html"
><B
CLASS="function"
>db2_fetch_both()</B
></A
>,
   <A
HREF="function.db2-fetch-array.html"
><B
CLASS="function"
>db2_fetch_array()</B
></A
>, or <A
HREF="function.db2-fetch-row.html"
><B
CLASS="function"
>db2_fetch_row()</B
></A
>,
   and branch if the fetch function returns <TT
CLASS="constant"
><B
>FALSE</B
></TT
>.
  </P
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>注意: </B
>
    If you issue a SELECT statement using a scrollable cursor,
    <B
CLASS="function"
>db2_num_rows()</B
> returns the number of rows returned by
    the SELECT statement. However, the overhead associated with scrollable
    cursors significantly degrades the performance of your application, so if
    this is the only reason you are considering using scrollable cursors,
    you should use a forward-only cursor and either call SELECT COUNT(*) or
    rely on the <A
HREF="language.types.boolean.html"
><B
CLASS="type"
>boolean</B
></A
> return value of the fetch functions to
    achieve the equivalent functionality with much better performance.
   </P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN81965"
></A
><H2
>参数</H2
><P
>&#13;   <P
></P
><DIV
CLASS="variablelist"
><DL
><DT
><CODE
CLASS="parameter"
>stmt</CODE
></DT
><DD
><P
>&#13;       A valid <TT
CLASS="literal"
>stmt</TT
> resource containing a result set.
      </P
></DD
></DL
></DIV
>
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN81975"
></A
><H2
>返回值</H2
><P
>&#13;   Returns the number of rows affected by the last SQL statement issued by
   the specified statement handle.
  </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.db2-num-fields.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.db2-pconnect.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>db2_num_fields</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.ibm-db2.html"
ACCESSKEY="U"
>上一级</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>db2_pconnect</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>