评论信息
<%
+ int floor = 1;
Connection comcon;
Statement comsql;
ResultSet comrs;
@@ -111,23 +169,24 @@
comcon = DriverManager.getConnection("jdbc:mysql://localhost/db_bbs", "root", "");
comsql = comcon.createStatement();
String comment = null;
- comment = "select comment,time from comment where subid = (select id from send where id ='" + id + "')";
+ comment = "select commentid,comment,time,username from comment where subid = (select id from send where id ='"
+ + id + "')";
comrs = comsql.executeQuery(comment);
try {
while (comrs.next()) {
%>
-
+
"
+ role="button">
<%=comrs.getString("comment")%>
+
- <%=comrs.getDate("time")%> <%=comrs.getTime("time")%>
+ <%=floor++%>L <%=comrs.getString("username")%> <%=comrs.getDate("time")%> <%=comrs.getTime("time")%>
-
-
-
@@ -140,21 +199,19 @@
comsql.close();
comrs.close();
comcon.close();
- String k1 = request.getQueryString();//得到ID的值(id=数字).
- String re = "\\D+";
- String result = k1.replaceAll(re, ""); //找到不是数字的字符,用""替代
%>