dba_exists()介绍

1、语法:

bool dba_exists ( string $key , resource $handle ) 

检查key是否存在

2、参数

  1. string $key key值
  2. resource $handle 数据库handler,通过调用 dba_open(), dba_popen() 函数返回

3、返回值

key存在返回TRUE,否则返回FALSE

 

dba_exists()实例

$dbh = dba_open( \"./data/products\", \"c\", \"db4\" )
       or die( \"Couldn\'t open data \" );
if (dba_exists(\'Tricorder\', $dbh)) {
    $res_del = dba_delete(\'Tricorder\', $dbh);
}
dba_close();
收藏 打印