1.下载sqlite并解压到d盘
官方地址为:http://www.sqlite.org/sqlite-3_6_3.zip
2. 运行DOS命令
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:/Documents and Settings/root>d:
D:/>sqlite3 test.db
SQLite version 3.6.3
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .database
seq name file
--- --------------- ----------------------------------------------------------
0 main D:/test.db
sqlite> create table test(id integer primary key,name text);
sqlite> insert into test(name) values("hello");
sqlite> select * from test;
1|hello
sqlite> insert into test(name) values("world");
sqlite> select * from test;
1|hello
2|world
sqlite>
3.下载xampp并且修改php/php.ini,将
;extension=php_pdo.dll
;extension=php_pdo_sqlite.dll
前而的;去掉,得到如下:
extension=php_pdo.dll
extension=php_pdo_sqlite.dll
4.重启apache,运行php代码,运行结果如下:http://baogg.cn/sqlite.php
5.建模工具
首先想到了DBDesigner,自带sqlite驱动,可以自动应用修改。但老是报错。
没办法,去下载了一个odbc,http://www.ch-werner.de/sqliteodbc/sqliteodbc.exe
什么建模工具都支持啦。
官方地址为:http://www.sqlite.org/sqlite-3_6_3.zip
2. 运行DOS命令
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:/Documents and Settings/root>d:
D:/>sqlite3 test.db
SQLite version 3.6.3
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .database
seq name file
--- --------------- ----------------------------------------------------------
0 main D:/test.db
sqlite> create table test(id integer primary key,name text);
sqlite> insert into test(name) values("hello");
sqlite> select * from test;
1|hello
sqlite> insert into test(name) values("world");
sqlite> select * from test;
1|hello
2|world
sqlite>
3.下载xampp并且修改php/php.ini,将
;extension=php_pdo.dll
;extension=php_pdo_sqlite.dll
前而的;去掉,得到如下:
extension=php_pdo.dll
extension=php_pdo_sqlite.dll
4.重启apache,运行php代码,运行结果如下:http://baogg.cn/sqlite.php
- <?php
- $db=sqlite_open("db.sqlite");
- @sqlite_query($db,"drop table test");
- sqlite_query($db,"create table test (id INTEGER PRIMARY KEY,name text);");
- sqlite_query($db,"insert into test (name) values('hello');");
- sqlite_query($db,"insert into test (name) values('world');");
- $result=sqlite_query($db,"select * from test");
- while($row=sqlite_fetch_array($result)) {
- print_r($row);
- }
- sqlite_close($db);
- ?>
首先想到了DBDesigner,自带sqlite驱动,可以自动应用修改。但老是报错。
没办法,去下载了一个odbc,http://www.ch-werner.de/sqliteodbc/sqliteodbc.exe
什么建模工具都支持啦。