|
dbmopen
Opens a DBM database
(PHP 4)
Parameters
Return Values
Returns an identifier to be passed to the other DBM functions on
success, or Notes
Note:
If NDBM support is used, NDBM will actually create
Note that PHP does its own file locking in addition to any file locking
that may be done by the DBM library itself. PHP does not delete the
Note:
When safe mode is enabled, PHP checks whether the files or directories you are about to operate on have the same UID (owner) as the script that is being executed.
See Also
Code Examples / Notes » dbmopensitz
Want to use dbmopen() to open an NDBM DB under solaris? Want to have GDBM support as well? Tough; you can't. You *can* use dba_open(), but you need to jump through a couple of hoops first: First, you need to re-roll libgdbm so that DBM/NDBM compatiblity are removed. For GDBM-1.7.3, change this line in the Makefile: OBJS = $(DBM_OF) $(NDBM_OF) $(GDBM_OF) to this: OBJS = $(GDBM_OF) Once that's installed, re-run ./configure --with-gdbm=/<prefix> --with-ndbm --with-db=/<prefix> <other args>, where <prefix> is the directory which holds the include/ directory containing the associated header files. make, make install, adjust your scripts to use dba_open() with the ndbm handler. Voila! mavetju
If you are running php >4.0.2 and you have suddenly problems with dbmopen (i.e. it complains that the function does not exist), recompile php with --with-ndb *and* --with-db
skipatrol
If using php3 on a win 95/98 machine, you must have the complete path to the db file. And always remember that if you user the " mark, add one extra slash before any regular slashes. Otherwise use the ' and normal slashes. $dmb = 'd:\httpd\storit\users'; $modify = dbmopen($dmb, "w"); $username = dbmfetch($modify, $email, $username); $password = dbmfetch($modify, $username, $password); echo "Current username: $username"; echo "Current password: $password"; exit; |