<?php
//phpinfo();
/**
* Simple example of extending the SQLite3 class and changing the __construct
* parameters, then using the open method to initialize the DB.
*/
class MyDB extends SQLite3
{
function __construct()
{
$this->open('test.db');
}
}
$db = new MyDB();
$db->exec('CREATE TABLE foo (bar STRING)');
$db->exec("INSERT INTO foo (bar) VALUES ('This is a test')");
$result = $db->query('SELECT bar FROM foo');
var_dump($result->fetchArray());
?>
运行的时候出现异常:Class 'SQLite3' not found in
。。。。。。
需要在php.ini中修改下面的配置
extension_dir = "C:/php/php7.0/ext" extension=php_pdo_sqlite.dll extension=php_sqlite3.dll sqlite3.extension_dir = "C:/php/php7.0/ext"