Sophie

Sophie

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

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
>dBase Functions</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="PHP 手册"
HREF="index.html"><LINK
REL="UP"
TITLE="函数参考"
HREF="funcref.html"><LINK
REL="PREVIOUS"
TITLE="dba_sync"
HREF="function.dba-sync.html"><LINK
REL="NEXT"
TITLE="dbase_add_record"
HREF="function.dbase-add-record.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=UTF-8"></HEAD
><BODY
CLASS="reference"
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.dba-sync.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.dbase-add-record.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="reference"
><A
NAME="ref.dbase"
></A
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="title"
>XXV. dBase Functions</H1
><DIV
CLASS="PARTINTRO"
><A
NAME="AEN33743"
></A
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="dbase.intro"
>简介</A
></H1
><P
>&#13;     These functions allow you to access records stored in dBase-format
     (dbf) databases.
    </P
><P
>&#13;     dBase files are simple sequential files of fixed length records. 
     Records are appended to the end of the file and delete records are
     kept until you call <A
HREF="function.dbase-pack.html"
><B
CLASS="function"
>dbase_pack()</B
></A
>.
    </P
><P
>&#13;     The types of dBase fields available are:
     <DIV
CLASS="table"
><A
NAME="AEN33750"
></A
><P
><B
>表 1. Available types of fields</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL><COL><COL><THEAD
><TR
><TH
>Field</TH
><TH
>dBase Type</TH
><TH
>Format</TH
><TH
>Additional information</TH
></TR
></THEAD
><TBODY
><TR
><TD
><TT
CLASS="literal"
>M</TT
></TD
><TD
>Memo</TD
><TD
>n/a</TD
><TD
>This type is not supported by PHP, such field will be ignored</TD
></TR
><TR
><TD
><TT
CLASS="literal"
>D</TT
></TD
><TD
>Date</TD
><TD
><TT
CLASS="literal"
>YYYYMMDD</TT
></TD
><TD
>The field length is limited to 8</TD
></TR
><TR
><TD
><TT
CLASS="literal"
>N</TT
></TD
><TD
>Number</TD
><TD
>A number</TD
><TD
>&#13;          You must declare a length and a precision (the number of digits
          after the decimal point)
         </TD
></TR
><TR
><TD
><TT
CLASS="literal"
>C</TT
></TD
><TD
>String</TD
><TD
>A string</TD
><TD
>You must declare a length. When retrieving data, the string
         will be right-padded with spaces to fit the declared length.</TD
></TR
><TR
><TD
><TT
CLASS="literal"
>L</TT
></TD
><TD
>Boolean</TD
><TD
><TT
CLASS="literal"
>T</TT
> or <TT
CLASS="literal"
>Y</TT
> for <TT
CLASS="constant"
><B
>TRUE</B
></TT
>, 
         <TT
CLASS="literal"
>F</TT
> or <TT
CLASS="literal"
>N</TT
> for <TT
CLASS="constant"
><B
>FALSE</B
></TT
></TD
><TD
>Stored and returned as an integer (1 or 0)</TD
></TR
><TR
><TD
><TT
CLASS="literal"
>F</TT
></TD
><TD
>Float</TD
><TD
>A float number</TD
><TD
>Support for this type of field was added in PHP 5.2.0</TD
></TR
></TBODY
></TABLE
></DIV
>
    </P
><DIV
CLASS="warning"
><P
></P
><TABLE
CLASS="warning"
BORDER="1"
WIDTH="100%"
><TR
><TD
ALIGN="CENTER"
><B
>警告</B
></TD
></TR
><TR
><TD
ALIGN="LEFT"
><P
>&#13;      There is no support for indexes or memo fields. There is no
      support for locking, too. Two concurrent web server processes
      modifying the same dBase file will very likely ruin your database.
     </P
><P
>&#13;      We recommend that you do not use dBase files as your production
      database. Choose any real SQL server instead; <A
HREF="http://www.mysql.com/"
TARGET="_top"
>MySQL</A
> or <A
HREF="http://www.postgresql.org/"
TARGET="_top"
>Postgres</A
>
      are common choices with PHP. dBase support is here to allow you to
      import and export data to and from your web database, because the
      file format is commonly understood by Windows spreadsheets and
      organizers.
     </P
></TD
></TR
></TABLE
></DIV
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="dbase.installation"
>安装</A
></H1
><P
>&#13;  In order to enable the bundled dbase library and to use these functions,
  you must compile PHP with the <CODE
CLASS="option"
>--enable-dbase
  </CODE
> option.
 </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="dbase.runtime"
>运行时配置</A
></H1
><P
>本扩展模块在 <TT
CLASS="filename"
>php.ini</TT
> 中未定义任何配置选项。</P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="dbase.resources"
>资源类型</A
></H1
><P
>本扩展模块未定义任何资源类型。</P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="dbase.examples"
>范例</A
></H1
><P
>&#13;     Many examples in this reference require a dBase database. We will use 
     <TT
CLASS="filename"
>/tmp/test.dbf</TT
> that will be created in the example of
     <A
HREF="function.dbase-create.html"
><B
CLASS="function"
>dbase_create()</B
></A
>.
    </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="dbase.constants"
>预定义常量</A
></H1
><P
>本扩展模块未定义任何常量。</P
></DIV
></DIV
><DIV
CLASS="TOC"
><DL
><DT
><B
>目录</B
></DT
><DT
><A
HREF="function.dbase-add-record.html"
>dbase_add_record</A
>&nbsp;--&nbsp;Adds a record to a database</DT
><DT
><A
HREF="function.dbase-close.html"
>dbase_close</A
>&nbsp;--&nbsp;Closes a database</DT
><DT
><A
HREF="function.dbase-create.html"
>dbase_create</A
>&nbsp;--&nbsp;Creates a database</DT
><DT
><A
HREF="function.dbase-delete-record.html"
>dbase_delete_record</A
>&nbsp;--&nbsp;Deletes a record from a database</DT
><DT
><A
HREF="function.dbase-get-header-info.html"
>dbase_get_header_info</A
>&nbsp;--&nbsp;Gets the header info of a database</DT
><DT
><A
HREF="function.dbase-get-record-with-names.html"
>dbase_get_record_with_names</A
>&nbsp;--&nbsp;
   Gets a record from a database as an associative array
  </DT
><DT
><A
HREF="function.dbase-get-record.html"
>dbase_get_record</A
>&nbsp;--&nbsp;
   Gets a record from a database as an indexed array
  </DT
><DT
><A
HREF="function.dbase-numfields.html"
>dbase_numfields</A
>&nbsp;--&nbsp;Gets the number of fields of a database</DT
><DT
><A
HREF="function.dbase-numrecords.html"
>dbase_numrecords</A
>&nbsp;--&nbsp;Gets the number of records in a database</DT
><DT
><A
HREF="function.dbase-open.html"
>dbase_open</A
>&nbsp;--&nbsp;Opens a database</DT
><DT
><A
HREF="function.dbase-pack.html"
>dbase_pack</A
>&nbsp;--&nbsp;Packs a database</DT
><DT
><A
HREF="function.dbase-replace-record.html"
>dbase_replace_record</A
>&nbsp;--&nbsp;Replaces a record in a database</DT
></DL
></DIV
></DIV
></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.dba-sync.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.dbase-add-record.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>dba_sync</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="funcref.html"
ACCESSKEY="U"
>上一级</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>dbase_add_record</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>