如果用户名字有中文字段,则可采用下面的。如无中文字段,更简单,改一下既可
<select name="class">
<%sql="select * from classinfo where class_code='"+User_Class+"'";
          rs=stmt.executeQuery(sql);
rs.next();%>
 <option value=<%=rs.getString("class_code")%>>
  <%=rs.getString("class_name")%></option>
<%sql="select * from classinfo order by id";
       rs=stmt.executeQuery(sql);
%>
<% while(rs.next())
                       {
                       %>
                      <option value=<%=rs.getString("class_code")%>>
                      <%=rs.getString("class_name")%></option>
                     <%
                      }
                     %>
                     </select>

解决方案 »

  1.   

    sjf801(刀口耳)  好象不对。
    <%sql="select * from classinfo where class_code='"+User_Class+"'";是什么意思?
    <%sql="select * from classinfo order by id";又有何用?
    class_code 和class_name以及User_Class分别代表什么?
    请高手指点。
      

  2.   


    <%sql="select * from classinfo where class_code='"+User_Class+"'";是说, 查询表classinfo  条件: class_code 为: 变量:User_Class<%sql="select * from classinfo order by id"> 根据id 排次序;
      

  3.   

    先从上一页接受变量
    如:String strName=request.getParameter("strName");
    之后在<select>
    <option>
    <%=strName%>
    </option>
    </select>
    这样就可以在下拉列表中显示了。
    如果还是不明白就给我发邮件[email protected]