simple_counter.php

来自「关于Berkelay数据库的共享源码」· PHP 代码 · 共 18 行

PHP
18
字号
<?php// Create a new Db4 Instance$db = new Db4();// Open it outside a Db4Env environment with datafile/var/lib/db4 // and database name "test"$db->open(null, "/var/tmp/db4", "test");// Get the current value of "counter"$counter = $db->get("counter");print "Counter Value is $counter\n";// Increment $counter and put() it.$db->put("counter", $counter+1);// Sync to be certain, since we're leaving the handle open$db->sync();?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?