<?php
include("include/inc_smarty.php");
include("include/inc_db_mysql.php");
 if($_GET[id]){
 $sql= "SELECT * FROM  test where Id=".$_GET[id];		//打开数据库
 $query = $db->query($sql);								//执行SQL语句返回结果
 $row = $db->fetch_row($query);							//一条数据写进数组里ROW用数字标识
 }else{
 	echo "参数错误";
 }
 $db->query('UPDATE test set hits=hits+1 where id='.$_GET[id]);
 function insert_hits(){ 								//不参与缓存的项目
 	global $row;
 	return $row[3];
 }
 $smarty->assign('row',$row);							//数组赋值给smarty的row
 $smarty->display("info.htm");							//在哪个页面执行
?>

