jsp按行删除的问题!!! 在jsp页面中,从数据库中遍历出数据,按照下面表格结构显示,如何按行删除,即点击一行的删除命令就删除改行数据呢!? 用户ID 用户名称 操作 1 1 删除 2 2 删除 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 点击时连接到另外一个或本页,传递要删除的唯一标示,然后删除就可以了只要你数据库中每一个数据都有一个唯一的标识的话直接用delete from your_table where 唯一标示 = 唯一标示 你点删除的时候找到每个记录对应的用户ID,sql:delete from 表 where id=用户ID <% for(int i=0;i<=count;i++)<tr> <td height="27" nowrap="nowrap" style="width:5%;"><%=i+1%> </td> <td style="width:12%;"><%=DataBean.getUserID()%> </td> <td style="width:7%;"> <img src='images/del.gif' width="18" height="17" border=0 title='删除该用户' onclick="DelUser('<%=DataBean.getUserID()%>');"></a> <input type="hidden" name="UserID"> </td> </tr>%> 在做循环的时候只能取到第一条记录! 我想利用form提交到一个servelet中删除,但在做上面的循环的时候只能取道第一条记录,请高手指点 function DelUser(UserID) { if(confirm("您确定要删除此用户吗?这样将删除此用户将不可恢复。")==true) { document.all.DelUserForm.UserID.value=UserID; DelUserForm.submit(); } } </script> <% for(int i=0;i<=count;i++)<tr><td height="27" nowrap="nowrap" style="width:5%;"><%=i+1%></td><td style="width:12%;"><%=DataBean.getUserID()%></td><td style="width:7%;"><img src='images/del.gif' width="18" height="17" border=0 title='删除该用户' onclick="DelUser('<%=DataBean.getUserID()%>');"></a><input type="hidden" name="UserID"></td></tr>%>在做循环的时候只能取到第一条记录!====================================你记录也没有movenext啊!这叫什么循环 <%out.print(" <a href=DeleteFile.jsp?id="+rs.getInt("XXX")+"&page="+intPage+">删除</a>");%> web.xml webservice 1.4 的客户端 如何调用 1.6的服务器端 java向xml如何写数据 SQL2000 全文搜索组件 装了用不了? (项目问题)一行html转XML的问题(急) 请问,Web页面中实现图形绘制功能的手段都有哪些? 【HELP】请问大家有没有功过 eXtremeComponents 这个组件?我配置了半天都配置不好.有谁可以帮帮我.. ASP,JSP 的WEB开发,你选择谁? jsp 中的PreparedStatement对象应用问题? jsp高手请进 怎么把查询到的记录导入EXCEL里,然后打印?急急 怎么把查询到的结果导入到EXCEL里打印?
只要你数据库中每一个数据都有一个唯一的标识的话
直接用delete from your_table where 唯一标示 = 唯一标示
<tr>
<td height="27" nowrap="nowrap" style="width:5%;"><%=i+1%>
</td>
<td style="width:12%;"><%=DataBean.getUserID()%>
</td>
<td style="width:7%;">
<img src='images/del.gif' width="18" height="17" border=0 title='删除该用户' onclick="DelUser('<%=DataBean.getUserID()%>');"></a>
<input type="hidden" name="UserID">
</td>
</tr>
%>
在做循环的时候只能取到第一条记录!
function DelUser(UserID)
{
if(confirm("您确定要删除此用户吗?这样将删除此用户将不可恢复。")==true)
{
document.all.DelUserForm.UserID.value=UserID;
DelUserForm.submit();
}
}
</script>
<tr>
<td height="27" nowrap="nowrap" style="width:5%;"><%=i+1%>
</td>
<td style="width:12%;"><%=DataBean.getUserID()%>
</td>
<td style="width:7%;">
<img src='images/del.gif' width="18" height="17" border=0 title='删除该用户' onclick="DelUser('<%=DataBean.getUserID()%>');"></a>
<input type="hidden" name="UserID">
</td>
</tr>
%>
在做循环的时候只能取到第一条记录!
====================================
你记录也没有movenext啊!这叫什么循环