PHP Manual
Prev |  | Next

# XX. 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);

Prev | Home | Next
dbase_numrecords | Up | dbmopen