mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-21 03:18:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@150808 c90b9560-bf6c-de11-be94-00142212c4b1
134 lines
3.5 KiB
XML
134 lines
3.5 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.6 $ -->
|
|
<!-- splitted from ./en/functions/dbase.xml, last change in rev 1.2 -->
|
|
<refentry id="function.dbase-create">
|
|
<refnamediv>
|
|
<refname>dbase_create</refname>
|
|
<refpurpose>Creates a dBase database</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>dbase_create</methodname>
|
|
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
|
<methodparam><type>array</type><parameter>fields</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>dbase_create</function> creates a dBase database
|
|
in the file <parameter>filename</parameter>,
|
|
with the fields <parameter>fields</parameter>.
|
|
</para>
|
|
<para>
|
|
The <parameter>fields</parameter> parameter is an array of
|
|
arrays, each array describing the format of one field in the
|
|
database. Each field consists of a name, a character indicating
|
|
the field type, a length, and a precision.
|
|
</para>
|
|
<para>
|
|
The types of fields available are:
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term>L</term>
|
|
<listitem>
|
|
<simpara>
|
|
Boolean. These do not have a length or precision.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>M</term>
|
|
<listitem>
|
|
<simpara>
|
|
Memo. (Note that these aren't supported by PHP.) These do
|
|
not have a length or precision.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>D</term>
|
|
<listitem>
|
|
<simpara>
|
|
Date (stored as YYYYMMDD). These do not have a length or
|
|
precision.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>N</term>
|
|
<listitem>
|
|
<simpara>
|
|
Number. These have both a length and a precision (the number
|
|
of digits after the decimal point).
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>C</term>
|
|
<listitem>
|
|
<simpara>
|
|
String.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
<note>
|
|
<para>
|
|
The fieldnames are limited in length and must not exceed 10 chars,
|
|
0 < chars <= 10.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
If the database is successfully created, a dbase_identifier is
|
|
returned, otherwise &false; is returned.
|
|
<example>
|
|
<title>Creating a dBase database file</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
// "database" name
|
|
$dbname = "/tmp/test.dbf";
|
|
|
|
// database "definition"
|
|
$def =
|
|
array(
|
|
array("date", "D"),
|
|
array("name", "C", 50),
|
|
array("age", "N", 3, 0),
|
|
array("email", "C", 128),
|
|
array("ismember", "L")
|
|
);
|
|
|
|
// creation
|
|
if (!dbase_create($dbname, $def))
|
|
echo "<strong>Error!</strong>";
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</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:"../../../../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
|
|
-->
|