|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-10-30 05:30 UTC] a dot stagl at gmx dot at
Description:
------------
I'm trying to open the contacts-databse from a nokia 9210i mobile, but it doesn't work.
Reproduce code:
---------------
$db_conn = dba_open("contacts.cdb","r","cdb");
if (!$db_conn) die ("opening failed");
$key = dba_firstkey ($db_conn);
while ($key != false)
{
echo $key."<br />";
echo dba_fetch ($key, $db_conn)."<br /><br />";
$key = dba_nextkey ($db_conn);
}
dba_close($db_conn);
Expected result:
----------------
...to get a list of key-value pairs.
Actual result:
--------------
The code didn't produce the expected output nor any error message. It seems that the commands dba_firstkey and dba_nextkey always return false instead of a key.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 07:00:02 2025 UTC |
It actually returns empty string. When you change the check to while ($key !== false) it'll crash: (gdb) bt #0 0x4072cf51 in kill () from /lib/i686/libc.so.6 #1 0x082762ac in _emalloc (size=1735290733, __zend_filename=0x8327600 "/usr/src/web/php/php4/ext/dba/dba_cdb.c", __zend_lineno=303, __zend_orig_filename=0x84a6220 "/usr/src/web/php/php4/Zend/zend_alloc.c", __zend_orig_lineno=218) at /usr/src/web/php/php4/Zend/zend_alloc.c:166 #2 0x082765c1 in _safe_emalloc (nmemb=1735290732, size=1, offset=1, __zend_filename=0x8327600 "/usr/src/web/php/php4/ext/dba/dba_cdb.c", __zend_lineno=303, __zend_orig_filename=0x0, __zend_orig_lineno=0) at /usr/src/web/php/php4/Zend/zend_alloc.c:218 #3 0x080bce64 in dba_nextkey_cdb (info=0x864eb74, newlen=0xbfffd4ec) at /usr/src/web/php/php4/ext/dba/dba_cdb.c:303 #4 0x080bbfa4 in zif_dba_nextkey (ht=1, return_value=0x86401ec, this_ptr=0x0, return_value_used=1) at /usr/src/web/php/php4/ext/dba/dba.c:914 Assigned to Marcus who added this thing.