<?php
$index = 4;
$id = dba_open("frenzy.db", "w", "flatfile");
if(!$id) exit ("發生錯誤...");
if(dba_exists($index, $id)) exit ("此鍵值已被使用");
dba_close($id);
?>
(PHP 4, PHP 5, PHP 7, PHP 8)
dba_exists — 檢查鍵值是否存在
版本 | 說明 |
---|---|
8.4.0 | dba 參數現在需要一個 Dba\Connection 實例;以前,需要一個有效的 dba 資源。 |
<?php
$index = 4;
$id = dba_open("frenzy.db", "w", "flatfile");
if(!$id) exit ("發生錯誤...");
if(dba_exists($index, $id)) exit ("此鍵值已被使用");
dba_close($id);
?>