各位谁有分类查询的代码!有下拉列表、选中某一项,在文本框中输入具体信息,最后根据填写的信息查询数据库。

解决方案 »

  1.   

    <form>
      <select>
      </select>
      <input type=text>
    </form>提交之后得到参数,然后查询....
    难道要现成的啊
      

  2.   

    <table width="778" border="0" cellspacing="0" bgcolor="#E4EDFB"  bordercolor="white" align="center">
    <form name="a1" method="post" action="news_brows.jsp">
    <tr><td align="center">
       &nbsp;<font size=2><b>查询:</b></font>&nbsp;&nbsp               
                <font size=2>关键字:</font>
    <INPUT TYPE="text" NAME="keyword" size=8 maxlength=40 value="<%= keyword %>">
          &nbsp;
      <font size=2>类别:</font>
      <select name="classid">
    <option value="">所有类别</option>  
      <%
      String sql03="select * from class";
      ResultSet rs03=db.execQuery(sql03);
      while(rs03.next()){%>     
                <option value="<%= rs03.getInt("Id")%>"><%= rs03.getString("class") %></option>
              <% }%>
                 </select>
        &nbsp;
                <INPUT TYPE="submit" name="submit" value="确定" >
    </td>         
     </tr>
     </form>
            </table>
      

  3.   

    masse(当午) 朋友已经告诉你方法了我的代码你自己改改看看能不能解决问题
      

  4.   

    String content=request.getParameter("[文本框名]");
    String type=request.getParameter("[下拉列表框名]");
     ......
    ResultSet rs = stmt.executeQuery("select * from [数据库] where [项] like '%"+content+"%' and [项]='"+type+"' order by id desc");
      

  5.   

    <select name="classId" onchange="document.fm.submit();">
                           <%
                               PageDB pageDB = new PageDB();
                       String strSQL = "select * from waybill";
                           ResultSet rs = pageDB.exeQuery(strSQL);
                       while(rsStr.next()){%>
                              <option value="<%= rsStr.getString("billId")%>" selected>订单号</option>
                              <option value="<%= rsStr.getString("sName")%>">托运人</option>
                              <option value="<%= rsStr.getString("cName")%>">收货人</option>              
                           <% }%>
                         </select>
            </td>                 
                        <td width="50%" align="center" bgColor="#bbcfff">   
                           <input type="text" name="keyword" size=30 value="<%= keyword %>">
                        </td>
                        <td width="25%" align="left" bgColor="#bbcfff">
                           <input name=submit type=submit value="搜索" style="cursor:hand" >
                        </td>
    我做到这个地方,请高手帮忙!