Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-release > by-pkgid > ebb1914cf182a88528b4547490db1dd8 > files > 1639

kdewebdev-quanta-doc-3.5.9-2mdv2008.1.x86_64.rpm

<HTML
><HEAD
><TITLE
>dbm functions</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK
REL="HOME"
TITLE="PHP Manual"
HREF="manual.html"><LINK
REL="UP"
TITLE="Function Reference"
HREF="funcref.html"><LINK
REL="PREVIOUS"
TITLE="dbase_numrecords"
HREF="function.dbase-numrecords.html"><LINK
REL="NEXT"
TITLE="dbmopen"
HREF="function.dbmopen.html"></HEAD
><BODY
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.dbase-numrecords.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.dbmopen.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="reference"
><A
NAME="ref.dbm"
></A
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="title"
>XI. dbm functions</H1
><DIV
CLASS="PARTINTRO"
><A
NAME="AEN7542"
></A
><P
>&#13;   These functions allow you to store records stored in a dbm-style
   database. This type of database (supported by the Berkeley db,
   gdbm, and some system libraries, as well as a built-in flatfile
   library) stores key/value pairs (as opposed to the full-blown
   records supported by relational databases).</P
><P
>&#13;   <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><P
><B
>Example 1. dbm example</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="programlisting"
>  1&nbsp;
  2&nbsp;$dbm = dbmopen("lastseen", "w");
  3&nbsp;if (dbmexists($dbm, $userid)) {
  4&nbsp;  $last_seen = dbmfetch($dbm, $userid);
  5&nbsp;} else {
  6&nbsp;  dbminsert($dbm, $userid, time());
  7&nbsp;}
  8&nbsp;do_stuff();
  9&nbsp;dbmreplace($dbm, $userid, time());
 10&nbsp;dbmclose($dbm);
 11&nbsp;</PRE
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
  </P
></DIV
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="function.dbmopen.html"
>dbmopen</A
> &#8212; opens a dbm database</DT
><DT
><A
HREF="function.dbmclose.html"
>dbmclose</A
> &#8212; closes a dbm database</DT
><DT
><A
HREF="function.dbmexists.html"
>dbmexists</A
> &#8212; tells if a value exists for a key in a dbm database</DT
><DT
><A
HREF="function.dbmfetch.html"
>dbmfetch</A
> &#8212; fetches a value for a key from a dbm database</DT
><DT
><A
HREF="function.dbminsert.html"
>dbminsert</A
> &#8212; inserts a value for a key in a dbm database</DT
><DT
><A
HREF="function.dbmreplace.html"
>dbmreplace</A
> &#8212; replaces the value for a key in a dbm database</DT
><DT
><A
HREF="function.dbmdelete.html"
>dbmdelete</A
> &#8212; deletes the value for a key from a dbm database</DT
><DT
><A
HREF="function.dbmfirstkey.html"
>dbmfirstkey</A
> &#8212; retrieves the first key from a dbm database</DT
><DT
><A
HREF="function.dbmnextkey.html"
>dbmnextkey</A
> &#8212; retrieves the next key from a dbm database</DT
><DT
><A
HREF="function.dblist.html"
>dblist</A
> &#8212; describes the dbm-compatible library being used</DT
></DL
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.dbase-numrecords.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="manual.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.dbmopen.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>dbase_numrecords</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="funcref.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>dbmopen</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>