del what from table where key=?

解决方案 »

  1.   

    把该表中的主键的值传到下一页去:while(rs.next()) {
    int primaryKeyValue = rs.getInt(PrimaryKeyName);%> 
    <tr>
    <td><%=rs.getString("user_name")%> </td>
    <td><%=rs.getString("credit_card")%> </td>
    <td><%=rs.getString("incash")%> </td>
    <td><%=rs.getString("outcash")%> </td>
    <td> 删除<a href="deluser.jsp?id=primaryKeyValue"> </td>
    </tr>在deluser.jsp中:
    String id = request.getParameter("id");
    String sql = "delete from table wehre PrimaryKey = " + id;
      

  2.   

    <a href="deluser.jsp?id=primaryKeyValue"> 删除</a> 
    然后你就可以用你的request对象得到这个id的值了,那时你想怎么做都行。
      

  3.   

    int primaryKeyValue = rs.getInt(PrimaryKeyName);
    这个是不是要换成这一行中某个字段名,会出错,出错信息
    Note: sun.tools.javac.Main has been deprecated.
    /test/news/agent.jsp:31: Undefined variable: Primaryuseruser_nameName
          int primaryuser_nameValue = rs.getInt(Primaryuseruser_nameName);
      

  4.   

    这个出错是变量Primaryuseruser_nameName没有定义呀!
      

  5.   

    <%int primaryuser_nameValue = rs.getInt(Primaryuseruser_nameName);%> 
    可是我已经定义了啊,这样写的
      

  6.   

    Primaryuseruser_nameName这个要在你数据库字段中有定义才行啊