X. dbm Functions

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).

Example 1. dbm example

$dbm = dbmopen("lastseen", "w");
if (dbmexists($dbm, $userid)) {
  $last_seen = dbmfetch($dbm, $userid);
} else {
  dbminsert($dbm, $userid, time());
}
do_stuff();
dbmreplace($dbm, $userid, time());
dbmclose($dbm);

Table of Contents
dbmopen — opens a dbm database
dbmclose — closes a dbm database
dbmexists — tells if a value exists for a key in a dbm database
dbmfetch — fetches a value for a key from a dbm database
dbminsert — inserts a value for a key in a dbm database
dbmreplace — replaces the value for a key in a dbm database
dbmdelete — deletes the value for a key from a dbm database
dbmfirstkey — retrieves the first key from a dbm database
dbmnextkey — retrieves the next key from a dbm database
dblist — describes the dbm-compatible library being used