PHP and DBA (db3)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello!
Trying to bring that code to work on win32.

---
<h1>dba_perf_test.php</h1>
<?php

$handlers = dba_handlers(true);

print "<pre>";
print_r($handlers);
print "</pre>";

$dbtype = "db3";
$dbfile = "C:/dbfile";
$nrecs = 100;

echo "using datafile: $dbfile.$dbtype<br>\n";


$id = dba_open($dbfile.".".$dbtype, "c", $dbtype); if (!$id) { die("\n<br>dhi: could not open dbfile"); }

for ($i=0; $i<$nrecs; $i++) {
    $key = rand(1, $nrecs);
    $value = date("D M j G:i:s T Y");


if(!dba_exists($key, $id)) { $ins = dba_insert($key, $value, $id); echo "inserted $key:$value in $dbfile.$dbtype<br>\n"; } } dba_close($id);


/// Finds in db $success = 0; $id = dba_open($dbfile.".".$dbtype, "r", $dbtype); if (!$id) { die("could not open dbfile"); } $success = 0; for ($i=0; $i<$nrecs; $i++) { $key = rand(1, $nrecs);

    if(dba_exists($key, $id)) {
        $success++;
    }
}
dba_close($id);

?>
---

Result:

Warning: dba_open(C:/dbfile.db3,c): Driver initialization failed for handler: db3: Permission denied in e:\data\dhidata\meddictool2\dba_news.php on line 18

Any Ideas? Thanks!
dhi

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux