mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-31 13:22:18 +02:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@157117 c90b9560-bf6c-de11-be94-00142212c4b1
137 lines
3.6 KiB
XML
137 lines
3.6 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.10 $ -->
|
|
<!-- EN-Revision: 1.6 Maintainer: yannick Status: ready -->
|
|
<refentry id="function.dbase-create">
|
|
<refnamediv>
|
|
<refname>dbase_create</refname>
|
|
<refpurpose>Crée une base de données dBase</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> crée une base de
|
|
données dBase dans le fichier <parameter>filename</parameter>,
|
|
et avec les champs <parameter>fields</parameter>.
|
|
</para>
|
|
<para>
|
|
<parameter>fields</parameter> est un tableau de tableaux. Chaque tableau
|
|
décrit le format d'un fichier de la base. Chaque champ est
|
|
constitué d'un nom, d'un caractère de type de champ,
|
|
d'une longueur et d'une précision.
|
|
</para>
|
|
<para>
|
|
Les types de champ disponibles sont :
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term>L</term>
|
|
<listitem>
|
|
<simpara>
|
|
<literal>Boolean</literal> (booléen). Pas de longueur ou
|
|
de précision pour ces valeurs.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>M</term>
|
|
<listitem>
|
|
<simpara>
|
|
<literal>Memo</literal>. (Note importante : les mémos ne
|
|
sont pas supportés par &php;.)
|
|
Elles n'ont pas de longueur ou de précision.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>D</term>
|
|
<listitem>
|
|
<simpara>
|
|
<literal>Date</literal> (enregistrée au format
|
|
<literal>'YYYYMMDD'</literal>). Elles n'ont pas de longueur ou
|
|
de précision.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>N</term>
|
|
<listitem>
|
|
<simpara>
|
|
<literal>Number</literal> (nombre). Possède une longueur
|
|
et une précision (le nombre de chiffres après la virgule).
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term>C</term>
|
|
<listitem>
|
|
<simpara>
|
|
<literal>String</literal> (chaîne de caractère).
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Le nom des champs est limité en longueur de caractères et ne doit pas
|
|
dépasser 10 caractères (0 < champs <= 10).
|
|
</para>
|
|
</note>
|
|
<para>
|
|
Si la base de données a été créée,
|
|
un identifiant de base <literal>dbase_identifier</literal> est
|
|
retourné, sinon, &false; est retourné.
|
|
<example>
|
|
<title>Création d'une base dBase</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
/* nom de la "base" */
|
|
$dbname = "/tmp/test.dbf";
|
|
|
|
/* "definition" de la base */
|
|
$def =
|
|
array(
|
|
array("date", "D"),
|
|
array("name", "C", 50),
|
|
array("age", "N", 3, 0),
|
|
array("email", "C", 128),
|
|
array("ismember", "L")
|
|
);
|
|
|
|
/* création */
|
|
if (!dbase_create($dbname, $def))
|
|
echo '<strong>Erreur!</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
|
|
-->
|