php 如何 配置sqlite
2019-09-03 12:26:32
0 评论
5153
- 星级
- -
PHP5已经绑定sqlite 1、手动添加的php的pdo的驱动扩展支持 ,在PHP.ini添加 extension=php_pdo.dll extension=php_pdo_sqlite.dll extension=php_sqlite.dll extension_dir = C:Program FilesApache Groupphp5ext 2、在C:Program FilesApache Groupphp5ext保证有php_sqlite.dll,php_pdo_sqlite.dll, php_pdo.dll扩展库 3、重启apache 4、下载SQLitemanager,create a database,保存名“db.sqlite”的数据库,建表, 或者sqliteadmin 5、在PHP链接SQLite 方法一、$db= new PDO('sqlite:db.sqlite') ; print_r($db); $sth = $db->query(select * from aqo); 方法二、if ($db = sqlite_open('db.db', 0666, $sqliteerror)) { sqlite_query($db, 'CREATE TABLE foo (bar varchar(10))'); sqlite_query($db, INSERT INTO foo VALUES ('fnord')); $result = sqlite_query($db, 'select bar from foo'); var_dump(sqlite_fetch_array($result)); } else { die($sqliteerror); }
发表屌论