PHP: dba_firstkey - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

dba_handlers dba_fetch

Last updated: Fri, 26 Jan 2007

view this page in

# dba_firstkey

(PHP 3 >= 3.0.8, PHP 4, PHP 5)

dba_firstkey -- Fetch first key

## Описание

string dba_firstkey ( resource handle )

dba_firstkey() returns the first key of the database and resets the internal key pointer. This permits a linear search through the whole database.

## Список параметров

`handle`

  The database handler, returned by dba_open() or dba_popen().

## Возвращаемые значения

Returns the key on success, or `FALSE` on failure.

## Смотрите также

dba_nextkey()
dba_key_split()
Example 2 in the DBA examples

add a note User Contributed Notes
dba_firstkey
psycho-logic at excite dot com
22-Oct-2003 05:38
`Looks like Jacky is using some DB object? I don't know if it's native to PHP or written on it's own... Anyways this is what I use:
$DBCon = dba_open("/tmp/test_db.db2", "r", "db2") or die("Uh oh, can't open the database :(");
if ($the_key = dba_firstkey($DBCon)) do {
print("Key: $the_key Value:");
print dba_fetch($the_key, $DBCon);
print("<BR>");
} while ($the_key = dba_nextkey($DBCon));
print ("<BR><BR><BR>Well looks like we're done here :-)");`
jacky dot jackyhung dot net
17-Jan-2002 05:17
`for ($key = dba_firstkey($this->handle); $key !== false; $key = dba_nextkey($this->handle)) {
$keyset[] = $key;
} // end for`
add a note
dba_handlers dba_fetch

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST