命令行下查询表以及表结构$ sqlite3 iteye.db3
SQLite version 3.8.10.2 2015-05-20 18:17:19
sqlite> .tables
Content DownloadFile
sqlite> .schema Content
CREATE TABLE Content([ID] integer primary key autoincrement,[已采] tinyint(1) default 0,[已发] tinyint(1) default 0,[标题] Text,[问题描述] Text,[tag] Text,[答案] Text,[最佳答案] Text,[PageUrl] Text );
CREATE INDEX YICAI ON Content ([已采]);
CREATE INDEX YIFA ON Content ([已发]);
在 PHP 扩展下查询$pdo = new PDO("sqlite:/Users/zhoumengkang/iteye.db3");
$tables = $pdo->query("select * from sqlite_master where type='table'")->fetchAll(PDO::FETCH_ASSOC );
$indexs = $pdo->query("select * from sqlite_master where type='index'")->fetchAll(PDO::FETCH_ASSOC );
var_dump($tables,$indexs);