1. Please don't cross post.
2. Which line is #23?
3. Have you tested to ensure that you have a valid handle? ($db_num)
4. Have you tried adding error code to see the result of dbase_create(), 
dbase_open()
5. I seem to remember reading in the docs, a long time ago (2 yr) that the 
dbase functions were not really reliable and were intended mostly to 
extract info for export to another database. I could not be 100% wrong on 
that, and I've not worked with the dbase functions in PHP.

After this reply, please keep this focused on the php-db list.

Regards - Miles Thompson

At 12:14 PM 7/4/2002 +0100, labhras sammin wrote:
>Hi I need to use PHP (ver 4 windows) to add a record to a dBase iv database.
>
>I can  create, open, read and close a database but when I try to add a
>record I always get  the following error:
>Warning: unexpected error in C:\php\phpstuff\addTest1.php on line 23
>
>Here is the code [shortened] that I use to create the database table, open
>the table, create the record and add the record- the database table has one
>field a 10 char string:
>
>$dbname = "test1.dbf";
>$dbflag = 2;
>$def = array( array("name",     "C",  10));
>dbase_create($dbname, $def));
>$db_num = dbase_open($dbname, $dbflag);
>$new_record['name'] = 'xxxxxxxxxx';
>dbase_add_record ($db_num, $new_record);
>
>any help, advice or code samples would be very appreciated
>thanks
>Labhras
>
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to