|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-05-31 07:09 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
Hello, I encountered a bug while working with the DBA Databse (well i guess thats a bug). I saved Guestbook entries in a DBa because of no support of mySQL at my account. The way it was saved: x.y = Value x= is the integer of the entry, eg 1,2,3,4... y= index of entry, usually to save Name, Title and so on, eg. 1.1, 1.2, 1.3,... Value is just a String. This is just en example later i created a DBA with ips, so the key string is an IP which means that it is unknow to me. Because of this lack of knowledge of the key names i thought to use the firstkey and nextkey functions to search the DB. I tried it at first at my Guestbook DBa = x.y=Value Here is the ineffective code: $id= dba_open ("postings.db", "w", "gdbm"); $str.= dba_firstkey($id)." First Key <br>"; for ($i=1;$i<=200;$i++){ if (dba_nextkey($id)==false){ $str.="$i = False<BR>";} else { $str.= dba_nextkey($id)."<br>";} } echo $str; dba_close($id); I know it is ineffective i used the for loop to make sure that it doenst stops too early . Fact is that this loop began at 6.3, what is completly nonsense, that is eiter the first key, nor the last. And i realized that this way to list them does not show all entries, even not the first 1.1. I guess thats a very big bug, because it makes it impossible to work with the DBA properly. I hope this description helps you to fix this bug. Samuel