Page 1 of 1

open 2 .dbf at same time

Posted: Tue Feb 19, 2008 5:26 am
by bouncer
hi there.

how can i make this code work ?
this code read a few line in both .dbf files and then stops and i dont know why. :(

Code: Select all

 
$sourceDocumentsDB = dbase_open('C:\ges\his.dbf', 0) or die (error());
$lineDB = dbase_open('C:\ges\via.dbf', 0) or die (error());
 
if ( $sourceDocumentsDB && $lineDB ) {
    $record_numbers_SourceDocuments = dbase_numrecords( $sourceDocumentsDB);
    $record_numbers_Line = dbase_numrecords( $lineDB);
 
    for ($n = 1; $n <= $record_numbers_SourceDocuments; $n++) {
        $row = dbase_get_record_with_names($sourceDocumentsDB, $n);
        for ($i = 1; $i <= $record_numbers_Line; $i++) {
            $row1 = dbase_get_record_with_names($lineDB, $i);
            if ($row['DOCID'] == $row1['LINEDOC']) {
                //.... do something here
            }
        }
    }
}
dbase_close( $lineDB );
dbase_close( $sourceDocumentsDB );
 
thanks in advance

Re: open 2 .dbf at same time

Posted: Wed Feb 20, 2008 4:17 am
by bouncer
any ideia ? :roll: