作者:6057318491 | 来源:互联网 | 2018-07-16 12:35
ec(2);php教程小型数据库教程(不用mysql教程做网站)includepdbm.php;$timestartexplode(,microtime());$timestart$timestart[0]+$timestart[1];$pdbmnewpdbm(test);$pdbm->open(pdbm_creat|pdb
php教程小型数据库教程(不用mysql教程做网站)
include 'pdbm.php';
$timestart = explode(' ', microtime());
$timestart = $timestart[0] + $timestart[1];
$pdbm = new pdbm('test');
$pdbm->open(pdbm_creat | pdbm_rewd);
for ($i = 0; $i <100000; $i++) {
$pdbm->insert("key{$i}", "value{$i}");
}
$timetime = explode(' ', microtime());
$timetime = $timetime[0] + $timetime[1];
echo $timetime - $timestart;
//*/
读取数据方法
include 'pdbm.php';
$timestart = explode(' ', microtime());
$timestart = $timestart[0] + $timestart[1];
$pdbm = new pdbm('test');
$pdbm->open(pdbm_rewd);
$val = $pdbm->fetch('key9999');
if ($val == null) {
echo 'not found';
} else {
echo $val."
";
}
//$pdbm->delete('key100'); //delete data
$val = $pdbm->fetch('key100');
if ($val == null) {
echo 'not found';
} else {
echo $val."
";
}
$timetime = explode(' ', microtime());
$timetime = $timetime[0] + $timetime[1];
echo $timetime - $timestart;
//*/