PHP: dba_exists - Manual (original) (raw)
(PHP 4, PHP 5, PHP 7, PHP 8)
dba_exists — Check whether key exists
Description
dba_exists() checks whether the specifiedkey exists in the database.
Return Values
Returns [true](reserved.constants.php#constant.true) if the key exists, [false](reserved.constants.php#constant.false) otherwise.
Changelog
| Version | Description |
|---|---|
| 8.4.0 | The dba parameter expects a Dba\Connection instance now; previously, a valid dba resource was expected. |
See Also
- dba_delete() - Delete DBA entry specified by key
- dba_fetch() - Fetch data specified by key
- dba_insert() - Insert entry
- dba_replace() - Replace or insert entry
Found A Problem?
frenzy dot ivan at gmail dot com ¶
17 years ago
<?php
$index = 4;
$id = dba_open("frenzy.db", "w", "flatfile");
if(!$id) exit ("Some error...");
if(dba_exists($index, $id)) exit ("This key is using");
dba_close($id);
?>