open 2 .dbf at same time

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bouncer
Forum Contributor
Posts: 162
Joined: Wed Feb 28, 2007 10:31 am

open 2 .dbf at same time

Post 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
Last edited by bouncer on Wed Feb 20, 2008 6:22 am, edited 1 time in total.
bouncer
Forum Contributor
Posts: 162
Joined: Wed Feb 28, 2007 10:31 am

Re: open 2 .dbf at same time

Post by bouncer »

any ideia ? :roll:
Post Reply