ptb_add
Adds one record to the $database. The record is appended at the end of database file. Proper format (ie. field order and number) is not verified.
Syntax
ptb_add($filename, $location, $fieldValues);
Syntax description
- $filename
- name of file containing the database
- $location
- location of $filename; can be:
- G
- globally defined (in ptb_ini.php) directory
- L
- local directory (ie. the same where script calling ptb_connect is placed)
- <path>
- other, defined directory, eg. /samples/db (no trailing slash)
- F
- filename (ie. absolute or relative path without DOCUMENT_ROOT dependency)
- $fieldValues
- full line of database file, formatted exactly how it is in the database, ie. with field values in proper order (which is set in the header), joined with a separator or (since version 1.2) array (may be multidimentional, eg. $var[3]); order of fields is not checked!
Return
This function returns true on success and null (=false) on failure.
Sample(s)
ptb_add('book.php', 'L', '7|M|Bob|Smith|London');