dbase_open
(PHP 5 < 5.3.0, dbase 5, dbase 7)
dbase_open — Opens a database
Description
$filename
, int $mode
) : resourcedbase_open() opens a dBase database with the given access mode.
Note: When safe mode is enabled, PHP checks whether the files or directories being operated upon have the same UID (owner) as the script that is being executed.
Note:
This function is affected by open_basedir.
Parameters
-
filename
-
The name of the database. It can be a relative or absolute path to the file where dBase will store your data.
-
mode
-
An integer which correspond to those for the open() system call (Typically 0 means read-only, 1 means write-only, and 2 means read and write).
Note:
You can't open a dBase file in write-only mode as the function will fail to read the headers information and thus you can't use 1 as
mode
.As of dbase 7.0.0 you can use
DBASE_RDONLY
andDBASE_RDWR
, respectively, to specify themode
.
Examples
Example #1 Opening a dBase database file
<?php
// open in read-only mode
$db = dbase_open('/tmp/test.dbf', 0);
if ($db) {
// read some data ..
dbase_close($db);
}
?>
Return Values
Returns a database link identifier if the database is successfully opened,
or FALSE
if an error occurred.
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-function.dbase-open.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.