DBASE

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
f_f_chopin
Forum Newbie
Posts: 2
Joined: Thu Aug 28, 2003 4:40 am

DBASE

Post 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
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post 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.
f_f_chopin
Forum Newbie
Posts: 2
Joined: Thu Aug 28, 2003 4:40 am

Post 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
Post Reply