dbase_add_recordDescriptiondbase_add_record() adds a new record to the specified dbf file. The values for the new record are taken from the record argument. The record argument should be a single-dimension array that has as many elements as the dbf file has rows. If any of the array elements contain values that are outside the bounds set by the row definition, the data will be silently truncated to the defined length for the row. The function will return FALSE in a wide variety of circumstances: - If the record argument is not an array - If the array doesn't contain the right number of elements - If the dbf_identifier argument doesn't refer to an open dbf file - If a memory allocation error occurs See alsoTo replace an existing record in a dbf file To mark a record for deletion from a dbf file To remove records marked for deletion ExampleExample 222. Open a dbf file and write a record to it $db_file = '/tmp/run_log.dbf'; # open dbf file for writing $id = @ dbase_open ($db_file, 1) or die ("Could not open dbf file <i>$db_file</i>."); # Quick and dirty insert of data dbase_add_record ($id, array ($SCRIPT_NAME, $UID, time ()) or die ("Could not add a record to dbf file <i>$db_file</i>.");
PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing
(Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch).
This material may be distributed only subject to the terms and conditions set forth
in the Open Publication License, v1.0 or later (the latest version is presently available at
http://www.opencontent.org/openpub/).
The authors of this book have elected not to choose any options under the OPL. This online book was obtained
from http://www.fooassociates.com/phpfer/
and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4
for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All
persons and entities shall have neither liability nor responsibility to any person or entity with respect to
any loss or damage arising from the information contained in this book.
|