php 安装 sqlite

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
  1.  <?php
  2.  $db=sqlite_open("db.sqlite"); 
  3.  @sqlite_query($db,"drop table test");
  4.  sqlite_query($db,"create table test (id INTEGER PRIMARY KEY,name text);");
  5.  sqlite_query($db,"insert into test (name) values('hello');"); 
  6.  sqlite_query($db,"insert into test (name) values('world');");
  7.  $result=sqlite_query($db,"select * from test"); 
  8.  while($row=sqlite_fetch_array($result)) { 
  9.    print_r($row); 
  10.  }
  11.  sqlite_close($db);
  12.  ?>
5.建模工具
   首先想到了DBDesigner,自带sqlite驱动,可以自动应用修改。但老是报错。
   没办法,去下载了一个odbc,http://www.ch-werner.de/sqliteodbc/sqliteodbc.exe
   什么建模工具都支持啦。   
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值