php无法打开sqlite3数据库

时间:2017-01-01 18:15:50

标签: php database sqlite

我已经在Stackoverflow,PHP Doc等上阅读了很多内容。到目前为止,没有什么可以帮助我在PHP 5.6中打开我的SQLite3数据库。这是我的代码段:

$db_file = "D:/Websites/Intranet/InetPub/wwwroot/WebDB/HamLog - SQLite/HamLog.SQLite";

// open database file

//$handle = sqlite_open($db) or die("Could not open database");      
//$db = new sqlite($db_file) or die("Could not open Dan's HamLog.SQLite");
//$db = new Database($db_file);
$this->db = new PDO("sqlite:.$db_file", NULL, NULL);
//$this->db = new SQLite3($db_file);

你可以看到我尝试了许多事情,这些事情都只是在开放尝试行中因错误代码而死亡。主动尝试至少会出错,说它无法打开数据库。我可以使用sqlite控制台打开数据库。显然在最近的PHP版本中,SQLite已经被PHP文档中的旧引用降级为默默无闻。我发现最好的是SQLite库现在位于PECL中。但后来我读到最好通过PEAR安装PECL。此时我需要一些帮助。如何在PHP中打开名为:HamLog.SQLite的SQLite数据库?

0 个答案:

没有答案