Comunitatea PHP Romania
 

 
dbase_create

dbase_create

(PHP 3, PHP 4 , PHP 5)

dbase_create -- Creates a dBase database

Description

int dbase_create ( string filename, array fields)

dbase_create() creates a dBase database in the file filename, with the fields 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.

Notã: The fieldnames are limited in length and must not exceed 10 chars, 0 < chars <= 10.

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

Exemplu 1. Creating a dBase database file

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

?>

Ultimele discutii in forum RSS Forum

Ultimele articole Ultimele articole

Top membri

Pirahna Pirahna
la birou
carco carco
Bucuresti
Birkoff Birkoff
Bucuresti
Mascka Mascka
Braila
raul_ raul_
whooper whooper
Toronto ON
mihaitha mihaitha
Sibiu
gabysolomon gabysolomon
Bacau
oriceon oriceon
Constanta
garlicinicolae garlicinicolae

Newsletter


Email:
 inscriere
 renuntare
 
 Arhiva newsletter

Parteneriat

Copyright © 2001-2008 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink Online Advertising | Mobile Phones | Debt Consolidation | Online Loans | Mortgage Calculator
Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
Powered by Simplis