X. DBM függvények
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).
Példa 1. DBM example 1
2 $dbm = dbmopen ("lastseen", "w");
3 if (dbmexists ($dbm, $userid)) {
4 $last_seen = dbmfetch ($dbm, $userid);
5 } else {
6 dbminsert ($dbm, $userid, time());
7 }
8 do_stuff();
9 dbmreplace ($dbm, $userid, time());
10 dbmclose ($dbm);
11 |
|
- Tartalom
- 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