• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/timemachine/db-4.7.25.NC/php_db4/samples/
1<?php
2// Create a new Db4 Instance
3$db = new Db4();
4
5// Open it outside a Db4Env environment with datafile/var/lib/db4
6// and database name "test"
7$db->open(null, "/var/tmp/db4", "test");
8
9// Get the current value of "counter"
10$counter = $db->get("counter");
11print "Counter Value is $counter\n";
12
13// Increment $counter and put() it.
14$db->put("counter", $counter+1);
15// Sync to be certain, since we're leaving the handle open
16$db->sync();
17?>
18