★ wanayoo — archive 1999 http://www.php.net/manual/function.dbase-create.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to dBase
Quick Reference
German version of this pageJapanese version of this pageItalian version of this pageFrench version of this pageHungarian version of this page
dBase
* dbase_create
* dbase_open
* dbase_close
* dbase_pack
* dbase_add_record
* dbase_replace_record
* dbase_delete_record
* dbase_get_record
* dbase_get_record_with_names
* dbase_numfields
* dbase_numrecords
Manual: dbase_create
View the source code for this pageSearch the site



Previous page
 dBase
 Updated
Sat, 12 Aug 2000
dbase_open 
Next page


dbase_create

(PHP3 , PHP4 )

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>";
      


 About Notes


Previous page
 dBase
 Updated
Sat, 12 Aug 2000
dbase_open 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.