<?php
session_start();
include("include/inc_smarty.php");
include("include/inc_db_mysql.php");

 $MyPg = new ShowPage(); 							//创建新分页
 $MyPg->dbselect('gz_lstbook','order by id desc');		//打开数据库
 $PageUrl = $MyPg->gzpage(10,'lst.php');				//多少条,翻页的地址
 $result = $db->query($sql);						//执行SQL语句返回结果
 while($read = $db->fetch_array($result))			//将结果循环赋到数组里，$read每次执行1次记录
	{
	$readarr[] = array("id"=>$read["Id"],"ntitle"=>$read["ntitle"],"name"=>$read["name"],"nsex"=>$read["nsex"],"npic"=>$read["npic"],"msgdate"=>$read["msgdate"],"email"=>$read["email"],
		"msgcontent"=>$read["msgcontent"],"userip"=>$read["userip"],"useripadd"=>$read["useripadd"],"recont"=>$read["recont"],"retime"=>$read["retime"],"rstate"=>$read["rstate"],
		"rqiao"=>$read["rqiao"],"hits"=>$read["hits"]);
	}
//print_r($readarr);								//打印数组的测试结果
 $smarty->assign('usrname',$_SESSION["usrname"]);									//数组赋值给smarty的row
 $smarty->assign('read',$readarr);					//数组赋值给smarty的read
 $smarty->assign('PageUrl',$PageUrl);				//翻页赋值给smarty的PageUrl
 $smarty->display("lst.htm");							//在哪个页面执行
?>

