★ wanayoo — archive 1999 http://fr.php.net/manual/function.dbase-create.phpNouvelle recherche | Portail wanayoo
PHP Thursday, April 26, 2001  
downloads | documentation | faq | support | reporting bugs | links 

search for in the  


previousdBase
dbase_opennext

Last updated: Mon, 08 Jan 2001

dbase_create

(PHP 3, PHP 4 )

dbase_create -- Creates a dBase database

Description

int dbase_create (string filename, array fields)

The fields 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.

The types of fields available are:

L

Boolean. These do not have a length or precision.

M

Memo. (Note that these aren't supported by PHP.) These do not have a length or precision.

D

Date (stored as YYYYMMDD). These do not have a length or precision.

N

Number. These have both a length and a precision (the number of digits after the decimal point).

C

String.

If the database is successfully created, a dbase_identifier is returned, otherwise false is returned.

Example 1. Creating a dBase database file


// "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))
    print "<strong>Error!</strong>";
      

previousdBase
dbase_opennext

Last updated: Mon, 08 Jan 2001
add note | about notes

show source | credits | mirror sites:  

Copyright © 2001 The PHP Group
All rights reserved.
This mirror generously provided by: L'Université Michel de Montaigne Bordeaux III
Last updated: Thu Apr 26 06:01:50 2001 MET DST