PHP+SQLite读取数据库中前5条数据


PHP程序读取SQLite数据库中前5条数据(测试用数据库文件test.db从这里下载),程序代码如下:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?  
$conn = new SQLiteDatabase('test.db');  
$sql = "select id,title from www_1500km_com limit 5 ";  
$x = $conn->arrayQuery($sql);  
foreach($x as $v){  
  ?><?=$v["id"]?>,<?=$v["title"]?><hr /><?  
}  
  
?>  

测试结果如下图: