日期:2014-05-17  浏览次数:20816 次

有关数据查询的问题大家帮我看一下?
<%
set   rs=server.createobject( "adodb.recordset ")
sql= "select   *   from   baojia   where   id= "&replace(request( "id "), " ' ", " ")  
rs.open   sql,conn,1,1  
do   until   rs.eof
%>
<table   width= "98% "   cellpadding= "1 "   cellspacing= "1 "   border= "0 ">
            <tr   bordercolor= "#D4D0C8 "   bgcolor= "#EEEEEE ">
                <td   width= "16% "   height= "20 "> <div   align= "center "> <%=left(rs( "gongshi "),10)%> </div> </td>
                <td   width= "7% "   height= "20 "> <div   align= "center "> <%=left(rs( "pin "),10)%> </div> </td>
                <td   width= "11% "> <div   align= "center "> <%=left(rs( "gui "),10)%> </div> </td>
                <td   width= "14% "> <div   align= "center "> <%=left(rs( "jia "),15)%> </div> </td>
                <td   width= "9% "> <div   align= "center "> <%=left(rs( "jie "),13)%> </div> </td>
                <td   width= "16% "> <div   align= "center "> <%=left(rs( "jiao "),10)%> </div> </td>
                <td   width= "12% "> <div   align= "center "> <%=left(rs( "chan "),10)%> </div> </td>
                <td   width= "15% "> <div   align= "center "> <%=left(rs( "youdate "),10)%> </div> </td>
            </tr>
        </table>
  <%
rs.movenext
loop
    %>
大家看这一段代码,其中这一句是
set   rs=server.createobject( "adodb.recordset ")
sql= "select   *   from   baojia   where   id= "&replace(request( "id "), " ' ", " ")  
rs.open   sql,conn,1,1  
这一句只是查询和上边一页传递的ID的值,我现在是想查询这个传过来的ID的的公司所发布的所有信息,这应怎么做?
比如,上一页,点公司A按扭后打开这一页就把这个公司A,以前所发布的信息都列出来......



------解决方案--------------------
这个估计需要传递上一页公司的名字或者公司的编号吧
在第一页设置点击前往
b.asp?ID=公司名
在b页设置
str=request.QueryString( "ID ")
sql= "select * from biao where 公司名= 'str ' "