DBM Functions [deprecated] XXVI. DBM Functions [deprecated]
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).
To use this functions you have to compile PHP with support for an
underlying database. See the
list of supported Databases.
In order to use these functions, you must compile PHP with dbm support
by using the --with-db option. In
addition you must ensure support
for an underlying database or you can use some system libraries.
This extension has no configuration directives defined in php.ini .
The function dbmopen() returns an database identifier
which is used by the other dbm-functions.
This extension has no constants defined.
Example 1. DBM example
<?php $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 dblist --
Describes the DBM-compatible library being used
dbmclose -- Closes a dbm databasedbmdelete --
Deletes the value for a key from 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
dbmfirstkey --
Retrieves the first key from a DBM database
dbminsert --
Inserts a value for a key in a DBM database
dbmnextkey --
Retrieves the next key from a DBM databasedbmopen -- Opens a DBM databasedbmreplace --
Replaces the value for a key in a DBM database
Links
Bluefish $6.95/mo 6GB Diskspace 100GB Bandwidth PHP Perl MySQL SSI CGI SSL Free Domain No Setup Fees No Hidden Fees IX Web Hosting $6.45/mo 400GB Diskspace 2500GB Bandwidth Host 8 Domains PHP Perl CGI SSI MySQL PostgreSQL 3 Free Domain For Life Additional costs for Windows plan + $2.50:ASP/.NET, Cold Fusion, ODBC/DSN, MSSQL AN Hosting $6.95/mo 250GB Diskspace 2500GB Bandwidth Host 20 Domains PHP RoR Python CGI SSI Unlimited MySQL DB Free Domain for Life 30 Day Money Back 99% Uptime Guarantee
Partners