用Access怎么设计留言板完整的数据库

用Access怎么设计留言板完整的数据库,第1张

1.个人资料基本表(USER):

USER_ID(用户ID)

USER_NAME(用户名称)

USER_QNAME(访客昵称)

USER_SEX(性别)

USER_IMG(头像)

USER_MAIL(邮箱地址)

USER_TEL(电话)

USER_MOBILE(移动电话)

USER_INTRODUCE(个人介绍)

USER_ADDR(用户地址)

USER_PASS(用户密码)

USER_Sts(用户状态)

USER_Bith_Date(用户生日)

USER_LOGINTIME(灯录时间

USER_LOGINNO(灯灵次数)

USER_OUTLINE(下线时间)

USER_REGITIME(注册时间)

USER_IP(IP)

USER_Accum(积分)

USER_Crdblty(信用度)

USER_DENGJI(用户等级)

这是个基本表,但是却是个很重要的表,因为接下来的表都是要跟他相关联的.

2.权限表(user_role)

r_id(权限ID)

r_userid(与用户表的ID相关联)

r_name(权限名称)

r_dsc(权限描述)

2.回帖和留言可以放在一起(USER_MESSAGE)

M_ID(信息ID)

M_USERID(与用户表的ID相关联)

M_time(留言时间)

m_updatetiem(留言修改时间)

m_name(留言主题)

m_dsc(留言内容)

m_model(留言模式)

m_rid(权限ID,与权限表相关联)

显示头像,需要在前台做处理

select 用户头像 from user where ....

我只回答数据库问题,所以就在这里回答了

先起来吧!

先设计一个表

一般字段:id【自动增加】,留言人,留言内容,留言时间,留言ip,留言人email,电话(等等),回复内容,回复时间,

有这么一些基本差不多了

剩下的就是写程序了

1.先做个提交留言的表单,再写动态语言,把表单提交到数据库

2.列表,留言内容分页显示,删除 *** 作在这个页面中完成

3.回复,即修改表中的回复内容和时间字段即可

有不明白的可以私下帮你一下

留言板要实现的功能是:浏览的人能留言并能分页的查看留言,管理员能对留言进行处理!

这个留言板由9个小程序组成,分别是:board.jspmessage.htmlopendata.jspmanager.jsppassword.jspcheck.jspdelete.jspconvert.jsp

现在说第一个:board.jsp

他的任务是整个留言板的主程序,让使用者留言,并提供分页功能!

在开始之前,我们必须在mysql数据库建立一个mydate的数据库,在mudate中建立名为message的表:

mysql>create table message( name char(20),email char(40 ),subject char(60),time char(60),sex char(10),memo text,id int not null auto_increment,primary key(id))

board.jsp代码:

<html>

<head>

<title>流言板</title>

</head>

<body>

<%@ page import="java.sql.*"%>

<%@ page contenttype="text/htmlcharset=gb2312"%>

<%@ include file="opendata.jsp"%>

<%

int count=0,lastp,numf,numl,prep,nextp,pageno

if(request.getparameter("pageno")==null) //pageno:代表页码

pageno=0

else

pageno=integer.parseint(request.getparameter("pageno"))

sql="select * from message"

rs=smt.executequery(sql)

while(rs.next())

count++<%-- count:多少留言--%>

lastp=(int)math.ceil((double)count/5)

<%--用来计算此表中有几页留言:ceil返回大于等于其数字参数的最小整数。

math.ceil(number)

必选项number 参数是数值表达式。

说明

返回值为大于等于其数字参数的最小整数。 --%>

if(pageno==0||pageno>lastp)

pageno=lastp

numf=pageno*5-4<%--显示留言的第一笔数据的编号_id--%>

numl=numf+4<%--numl:此页的最后的一笔数据编号id--%>

if(pageno==1)

prep=1<%-- prep:上一页--%>

else

prep=pageno-1

if(pageno==lastp)

nextp=lastp

else

nextp=pageno+1

sql="select * from message where id between "+numf+" and "+numl

rs=smt.executequery(sql)

%>

<font size=7 color=green>留言板</font>

<hr>

<center>

<form action=board.jsp method=post>

<table boder=0>

<tr>

<td>目前的页次<font color=red><%=pageno%></font>/<font color=blue><%=lastp%></font></td>

<td><a href=board.jsp?pageno=<%=prep%>>[上一页]</a></td>

<%--将参数pageno传递给程序,依据它来计算numl和numf,再将留言数据通过sql取出--%>

<td><a href=board.jsp?pageno=<%=nextp%>>[下一页]</a></td>

<td><a href=board.jsp?pageno=1>[第一页]</a></td>

<td><a href=board.jsp>[最后一页]</a></td>

<td>输入页次<input type=text size=3 name=pageno></td>

<td><input type=submit name=send value=送出></td>

<td><a href=password.jsp><font color=red size="5"><i>站长专用</i></font></a></td>

</tr>

</table>

</form>

<%

string name,email,subject,time,sex,memo

while(rs.next())

{

name=rs.getstring(1)

email=rs.getstring(2)

subject=rs.getstring(3)

time=rs.getstring(4)

sex=rs.getstring(5)

memo=rs.getstring(6)

out.print("<center>")

out.print("<table border=1>")

out.print("<tr><td bgcolor=yellow>姓名</td><td>"+name+"</td></tr>")

out.print("<tr><td bgcolor=yellow>e-mail</td><td>"+email+"</td></tr>")

out.print("<tr><td bgcolor=yellow>时间</td><td>"+time+"</td></tr>")

out.print("<tr><td bgcolor=yellow>主题</td><td>"+subject+"</td></tr>")

out.print("<tr><td bgcolor=yellow>留言</td><td>"+memo+"<img src="+sex+"></td></tr>")

out.print("</table><p>")

}

%>

<hr>

<center><a href="message.html">我要留言</a>

<a href=board.jsp>查看留言</a>

</body>

</html>


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/10085207.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-05
下一篇2023-05-05

发表评论

登录后才能评论

评论列表(0条)

    保存