ID: 33480 Updated by: [EMAIL PROTECTED] Reported By: info at heyne dot biz -Status: Open +Status: Feedback Bug Type: dBase related Operating System: Suse 9.0 PHP Version: 5.0.4 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2005-06-26 15:13:05] info at heyne dot biz Description: ------------ dbase_add_record() failed with 'unexpected error' Problem located in dbase.c: PHP_FUNCTION(dbase_add_record) { ..... for (i = 0, cur_f = dbf; cur_f < &dbf[num_fields]; i++, cur_f++) { zval tmp; if (zend_hash_index_find(Z_ARRVAL_PP(fields), i, (void **)&field) == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "unexpected error"); efree(cp); RETURN_FALSE; } Reproduce code: --------------- $db = dbase_open( 'test.dbf', 2 ); $record = dbase_get_record_with_names ( $db, 1); unset($record['deleted']); dbase_add_record( $db, $record ); dbase_close($db); --> test.dbf contains only String fields ! <-- Expected result: ---------------- Record should be inserted Actual result: -------------- Warning: dbase_add_record() [function.dbase-add-record]: unexpected error in .../export_db.php on line 4 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33480&edit=1