Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
f_f_chopin
Forum Newbie
Posts: 2 Joined: Thu Aug 28, 2003 4:40 am
Post
by f_f_chopin » Thu Aug 28, 2003 4:40 am
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
JAM
DevNet Resident
Posts: 2101 Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:
Post
by JAM » Sun Aug 31, 2003 8:52 pm
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 » Mon Sep 01, 2003 4:31 am
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