Code: Select all
<?php
// Set the db parameters
$dbPath = "myDatabase.db";
$dbType = "db3";
function CreateDatabase($thePath, $theType)
{
$db = dba_open($thePath, "c", $theType);
if(!$db)
{
printf("Could not create the database");
return 0;
}
return $db;
}
function OpenDatabase($thePath, $theType)
{
$db = dba_open($thePath, "r", $theType);
if (!$db)
{
printf("Could not open the database");
return 0;
}
return $db;
}
// Open the database, if it isn't there, create it.
$db = OpenDatabase($dbPath, $dbType);
if(!$db)
{
$db = CreateDatabase($dbPath, $dbType);
if(!$db)
{
exit;
}
}
?>Code: Select all
error:
Warning: dba_open(myDatabase.db,r) [function.dba-open]: Driver initialization failed for handler: db3: Permission denied in C:\wamp\www\DBAtest\DBAtest.php on line 20
Could not open the database
Warning: dba_open(myDatabase.db,c) [function.dba-open]: Driver initialization failed for handler: db3: Permission denied in C:\wamp\www\DBAtest\DBAtest.php on line 8
Could not create the databaseI asked this on the WAMP forums and all I was told is to use sqlitemanager to open the database. Well I go into sqlitemanager and there is an option for version and I can select 2 or 3, 3 is grayed out. I'm assuming 3 is that one I want for DB3 but I could be wrong, I'm still learning about this. I looked through PHPinfo and under the section for DBA, DB3 is listed. I'm not sure what I'm doing wrong and I'm at a loss for where I should be looking.
Any help you could give would be greatly appreciated. I should note that this is my first post here, I hope I used the tags correctly.
-Gunder