php中如何读取sqlite数据库文件的数据

//sqlite2:

$db_name = 'test.db';
$conn = new SQLiteDatabase($db_name);
//$conn->Query( "CREATE TABLE test ( id  INTEGER NOT NULL   PRIMARY KEY , title   VARCHAR ( 25 )   NOT NULL , content  VARCHAR   ( 50 ) NOT NULL )" );
//$conn->Query( "INSERT INTO test (title, content) VALUES ('caisangzi','raytang')" );
$sql = 'select * from test';
$result = $conn->arrayQuery($sql);
var_dump($result);


//sqlite3:

$db_name = 'sqlite3.db';
$conn = new sqlite3($db_name);
$sql = 'select * from `user`';
$result = $conn->query($sql)->fetcharray();

var_dump($result);


注意:似乎sqlite2模块不支持`这个特义标记

你可能感兴趣的:(sql,数据库,PHP,sqlite,null,Integer)