dongzhangnong2063 2017-01-01 18:15
浏览 89

php无法打开sqlite3数据库

I have read a good bit on Stackoverflow, PHP Doc's, etc. So far nothing helps me open my SQLite3 database in PHP 5.6. This is my code snippet:

$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);

You can see I've tried a number of things that all just died at the open attempt line with an error code. The active try at least gives an error saying it is unable to open the database. I can open the database using the sqlite console. Apparently in recent PHP releases, SQLite has been relegated to obscurity, by old references in the PHP documentation. The best I've found is the SQLite library is now housed in PECL. But then I read that its best to install PECL through PEAR. At this point I need some help. How do I open my SQLite database named: HamLog.SQLite in PHP?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Oracle触发器记录修改前后的字段值
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器