PHP 手冊
前一頁 |  | 下一頁

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

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

# 需求

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.

# 預先定義常數

這個延伸沒有定義任何常數。

# 範例

範例 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); ?>`

前一頁 | 內容 | 下一頁
dbase_replace_record | 上一層 | dblist