Page 1 of 1

DBASE

Posted: Thu Aug 28, 2003 4:40 am
by f_f_chopin
When I run this code:

$db_id = dbase_open( "C:\Sample.dbf", 2);

$rec[] = "Frederic";

dbase_add_record($db_id, $rec);

dbase_close($db_id);

I get this error

Warning: Wrong number of fields specified in sample.php on line 9

The dbf table has only one field of type character. Line 9 is the dbase_add_record() line.

Could anyone tell me what is causing the error.

Thanks

Posted: Sun Aug 31, 2003 8:52 pm
by JAM
Not sure (never dealt with dbase), but
FIELD_TYPE Character 1
And you are inserting a string > 1 char long. You could check that.

Posted: Mon Sep 01, 2003 4:31 am
by f_f_chopin
I found out what the problem was, it was that the version of DBF file I was using was version 7, PHP only supports 3-4. I made a table in an old version of Dbase and it worked fine