PHP Paradox File Access Functions

EditRocket provides the following information on Paradox File Access functions in the PHP source code builder.

bool px_close ( resource $pxdoc ) - Closes the paradox database. This function will not close the file.

bool px_create_fp ( resource $pxdoc , resource $file , array $fielddesc ) - Create a new paradox database file.

string px_date2string ( resource $pxdoc , int $value , string $format ) - Turns a date as it stored in the paradox file into human readable format. Paradox dates are the number of days since 1.1.0000. This function is just for convenience. It can be easily replaced by some math and the calendar functions as demonstrated in the example below.

bool px_delete ( resource $pxdoc ) - Deletes the resource of the paradox file and frees all memory.

bool px_delete_record ( resource $pxdoc , int $num ) - This function deletes a record from the database. It does not free the space in the database file but just marks it as deleted. Inserting a new record afterwards will reuse the space.

array px_get_field ( resource $pxdoc , int $fieldno ) -

array px_get_info ( resource $pxdoc ) -

string px_get_parameter ( resource $pxdoc , string $name ) - Gets various parameters.

array px_get_record ( resource $pxdoc , int $num [, int $mode ] ) -

array px_get_schema ( resource $pxdoc [, int $mode ] ) - px_get_schema() returns the database schema.

float px_get_value ( resource $pxdoc , string $name ) - Gets various values.

int px_insert_record ( resource $pxdoc , array $data ) - Inserts a new record into the database. The record is not necessarily inserted at the end of the database, but may be inserted at any position depending on where the first free slot is found.

resource px_new ( void ) - Create a new paradox object. You will have to call this function before any further functions. px_new() does not create any file on the disk, it just creates an instance of a paradox object. This function must not be called if the object oriented interface is used. Use new paradox_db() instead.

int px_numfields ( resource $pxdoc ) - Get the number of fields in a database file.

int px_numrecords ( resource $pxdoc ) - Get the number of records in a database file.

bool px_open_fp ( resource $pxdoc , resource $file ) - Open an existing paradox database file.

bool px_put_record ( resource $pxdoc , array $record [, int $recpos ] ) - Stores a record into a paradox database. The record is always added at the end of the database, regardless of any free slots.

array px_retrieve_record ( resource $pxdoc , int $num [, int $mode ] ) -

bool px_set_blob_file ( resource $pxdoc , string $filename ) - Sets the name of the file where blobs are going to be read from or written into.

bool px_set_parameter ( resource $pxdoc , string $name , string $value ) - Sets various parameters.

void px_set_tablename ( resource $pxdoc , string $name ) -

bool px_set_targetencoding ( resource $pxdoc , string $encoding ) - Set the encoding for data retrieved from a character field. All character fields will be recoded to the encoding set by this function. If the encoding is not set, the character data will be returned in the DOS code page encoding as specified in the database file. The encoding can be any string identifier known to iconv or recode. On Unix systems run iconv -l for a list of available encodings.

bool px_set_value ( resource $pxdoc , string $name , float $value ) - Sets various values.

string px_timestamp2string ( resource $pxdoc , float $value , string $format ) - Turns a timestamp as it stored in the paradox file into human readable format. Paradox timestamps are the number of milliseconds since 1.1.0000. This function is just for convenience. It can be easily replaced by some math and the calendar functions as demonstrated in the following example.

bool px_update_record ( resource $pxdoc , array $data , int $num ) - Updates an exiting record in the database. The record starts at 0.