郭晓湉于星期四, 12/09/2013 – 19:40提交
首先显示一下数据库的数据
页面信息
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">< html xmlns="">< head>< meta http-equiv="Content-Type" content="text/html; charset=utf-8" />< title>无标题文档</title>< /head>
<body>< center><table style="border:dotted;border-color:#F06">< caption>留言内容</caption>< tr><th>编号</th><th>用户</th><th>标题</th><th>内容</th><th>发表时间</th></tr>< ?php$link=mysql_connect(‘localhost’,’root’,’123′)or die("数据库连接失败");//连接数据库mysql_select_db(‘lyb’,$link);//选择数据库mysql_query("set names utf8");//设置编码格式
$q="select * from content";//设置查询指令$result=mysql_query($q);//执行查询while($row=mysql_fetch_assoc($result))//将result结果集中查询结果取出一条{echo"<tr><td>".$row["id"]."</td><td>".$row["username"]."</td><td>".$row["title"]."</td><td>".$row["content"]."</td><td>".$row["lastdate"]."</td><tr>";}?>< /table>< a href="liuyanban.html">返回</a>
</center>< /body>< /html>
页面显示效果如下:
,每一天都是一个阶梯,是向既定目标迈进的新的一步。