dblist> <dbase_replace_record
Last updated: Mon, 29 Oct 2007

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

注意: DBM support is deprecated and you are encouraged to use the Database (dbm-style) abstraction layer functions instead.

注意: This extension has been removed from PHP and is no longer available as of PHP 5.0.0.

需求

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.

运行时配置

本扩展模块在 php.ini 中未定义任何配置选项。

资源类型

The function dbmopen() returns an database identifier which is used by the other dbm-functions.

预定义常量

本扩展模块未定义任何常量。

范例

例447.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);

?>

目录

dblist Describes the DBM-compatible library being used
dbmclose Closes a dbm database
dbmdelete 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
dbmopen Opens a DBM database
dbmreplace Replaces the value for a key in a DBM database


add a note add a note User Contributed Notes
DBM Functions [deprecated]
There are no user contributed notes for this page.

dblist> <dbase_replace_record
Last updated: Mon, 29 Oct 2007