Replace/Update record in dbase using dbase_replace_record()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ave,

Can¹t figure this one out. I¹m using the dbase_replace_record() function to
replace a record in a dbase (.dbf) database. I just want to replace the
value of one of the fields with another value. This is my code:

$db = dbase_open("CRUMBS.DBF", 2) or die("Fatal Error: Could not open
database!");
if ($db) {
      $record_numbers = dbase_numrecords($db);
      for ($i = 1; $i <= $record_numbers; $i++) {
         $row = dbase_get_record_with_names($db, $i);
         if ($row['PHONE'] == $thekey) {
          print_r($row);
          $row['A'] == "F";
          dbase_replace_record($db, $row, 1);
    }
  }
}
dbase_close($db);

Basically I have a database called ³CRUMBS.DBF², and the record where PHONE
= $thekey, I want to replace the value of the field ³A² with ³F². I keep
getting the error: ³Wrong number of fields specified².
I have over 60 fields in each row ­ and I just want to replace the value of
the field ³A². 

Any suggestions?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: sleepwalker@xxxxxxxxxxxxxxxx

³I morti non sono piu soli ... The dead are no longer lonely²


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux