★ wanayoo — archive 1999 http://www.php.net/manual/function.dbmnextkey.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to DBM
Quick Reference
DBM
* dbmopen
* dbmclose
* dbmexists
* dbmfetch
* dbminsert
* dbmreplace
* dbmdelete
* dbmfirstkey
* dbmnextkey
* dblist
Manual: dbmnextkey
View the source code for this pageSearch the site



Previous page
 dbmfirstkey
dblist 
Next page


dbmnextkey

(PHP3 , PHP4 )

dbmnextkey -- retrieves the next key from a dbm database

Description

string dbmnextkey (int dbm_identifier, string key)

Returns the next key after key. By calling dbmfirstkey() followed by successive calls to dbmnextkey() it is possible to visit every key/value pair in the dbm database. For example:

Example 1. Visiting every key/value pair in a dbm database.

  1 
  2 $key = dbmfirstkey($dbm_id);
  3 while ($key) {
  4     echo "$key = " . dbmfetch($dbm_id, $key) . "\n";
  5     $key = dbmnextkey($dbm_id, $key);
  6 }
  7      


User Contributed Notes: dbmnextkey


karutla@hotmail.com
01-Oct-1999 10:14
$key = dbmfirstkey($dbm_id); while ($key) { dbmreplace($dbm_id, $value); $key = dbmnextkey($dbm_id, $key); } doesn't seem to iterate through all the records properly.


hiongun@kt.co.kr
08-Oct-1999 01:52
$key = dbmnextkey($dbm_id, $key) returns "" on the second call.


 About Notes


Previous page
 dbmfirstkey
dblist 
Next page



Site Statistics


Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.