Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

Date D^ Dates are stored in YYYYMMDD format and do not use length or precision.


NumberN^ The length property refers to the and the precision refers to the numbetotal number of digits in the number r of digits after the decimal point.


String C^ The length property specifies how mafield. The precision property is not used.ny characters are stored in the


If a database is successfully created, a database identifier is returned; otherwise FALSE is
returned.


<?
// create field definition
$fields = array(
array("Name", "C", 32),
array("Balance", "N", 8, 2),
array("Birthday", "D"),
array("Commercial", L));


$db = dbase_create("customer.dbf", $fields);


dbase_close($db);
?>


boolean dbase_delete_record(integer database, integer record)


The dbase_delete_record function marks a record for deletion. The record will remain
in the database until dbase_pack is called.


<?
//open connection to database
$db = dbase_open("customer.dbf", 2);


//mark record for deletion
dbase_delete_record($db, 2);


//close connection
dbase_close($db);
?>


array dbase_get_record(integer database, integer record)


The dbase_get_record function returns the fields of a record in an array. The first field
will be numbered zero. In addition, an element indexed by deleted will contain 1 if the
row was marked for deletion. Records are numbered from one.

Free download pdf