php-doc-en/reference/dbase/functions/dbase-open.xml
Daniel Egeberg 96c9d88bad Converted to utf-8
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@297028 c90b9560-bf6c-de11-be94-00142212c4b1
2010-03-28 22:10:10 +00:00

116 lines
2.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.dbase-open" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>dbase_open</refname>
<refpurpose>Opens a database</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>dbase_open</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
<function>dbase_open</function> opens a dBase database with the given
access mode.
</para>
&note.sm.uidcheck;
&note.open-basedir.func;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
<para>
The name of the database. It can be a relative or absolute path to
the file where dBase will store your data.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
An integer which correspond to those for the <command>open()</command>
system call (Typically 0 means read-only, 1 means write-only, and 2
means read and write).
</para>
<note>
<para>
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
<parameter>mode</parameter>.
</para>
</note>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Opening a dBase database file</title>
<programlisting role="php">
<![CDATA[
<?php
// open in read-only mode
$db = dbase_open('/tmp/test.dbf', 0);
if ($db) {
// read some data ..
dbase_close($db);
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a database link identifier if the database is successfully opened,
or &false; if an error occurred.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>dbase_create</function></member>
<member><function>dbase_close</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->