mfcdb_open

Open a table of database.


Prototype:

resource mfcdb_open ( string $tablename, int $mode )




Open the table identified by tablename. The extension takes care of open .dat e .idx , so you must only specify the table name without any extension.

Some Micro Focus Cobol archive use the sequential record file without extension so you must rename or create a symbolic link to this file with a file containing right extension:
$ ls mydatabase*
mydatabase  mydatabase.idx

$ ln -s mydatabase mydatabase.dat
$ ls mydatabase*
mydatabase  mydatabase.dat  mydatabase.idx



RETURN The function returns the resource associated to the open table or FALSE if an error occurred. You can use mfcdb_error() to get error string.

Example

<?php
$resource = mfcdb_open("mydatabase");
 
if($resource == FALSE) {
  die("An error occurred opening table, error is: ".mfcdb_error()."\n");
}
 
echo "Resource dump: ".print_r($resource, true)."\n";
 
if(mfcdb_close($resource) == FALSE) {
  die("An error occurred closing table, error is: ".mfcdb_error()."\n");
}
 
?>
documentation/mfcdb_open.txt · Ultima modifica: 2008/08/22 23:09 da gchiesa