?? edittypeok.jsp
字號(hào):
<%@ include file="conn.jsp"%>
<%@ include file="isadmin.jsp"%>
<%
request.setCharacterEncoding("GB2312");
String id=request.getParameter("id");
String addtype=request.getParameter("addtype");
if(addtype==null){
out.print("<script>alert('請(qǐng)輸入欄目名');history.go(-1);</script>");
}
String sql="select * from scott.type where type='"+addtype+"' and typeid<>"+id;
ResultSet rs=stmt.executeQuery(sql);
if(rs.next()){
out.print("<SCRIPT language=JavaScript>alert('數(shù)據(jù)庫(kù)中已經(jīng)有一個(gè)名為"+addtype+"的欄目了!');");
out.print("history.go(-1);</SCRIPT>");
}else{
stmt.executeUpdate("update scott.type set type='"+addtype+"' where typeid='"+id+"'");
out.print("<script>alert('修改成功');window.location.href='addtype.jsp';</script>");
}
%>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -