查询时查不到 id1 和id为最后一个数据
我有一个asp显示页面。数据 是数据库某一个表中的,显示是全部显示了。但是我查询时 就是查不到id为1和id为最后的数据。 提示: 就是显示了全部数据,就是查不到id为1和id为最后的数据。 下面一个是我的查询条件 。后面那个不怎么懂。- -
程序代码:<script language="javascript">
function jumpTo(i){
if(i==1){
this.document.location="chakanfangyingdui.asp?sheng=<%=sheng%>&shi=<%=shi%>&xian=<%=xian%>&gjz=<%=gjz%>&gs=<%=gs%>";}
if(i==2){
this.document.location="chakanfangyingdui.asp?page=<%=page-1%>&sheng=<%=sheng%>&shi=<%=shi%>&xian=<%=xian%>&gjz=<%=gjz%>&gs=<%=gs%>";}
if(i==3){
this.document.location="chakanfangyingdui.asp?page=<%=page+1%>&sheng=<%=sheng%>&shi=<%=shi%>&xian=<%=xian%>&gjz=<%=gjz%>&gs=<%=gs%>";}
if(i==4){
this.document.location="chakanfangyingdui.asp?page=<%=rs.pageCount%>&sheng=<%=sheng%>&shi=<%=shi%>&xian=<%=xian%>&gjz=<%=gjz%>&gs=<%=gs%>";}
}
function addlineeffect(id,element)//获取ID为id的对象下的所有element元素!
{
var tr=[];
tr=document.getElementById(id).getElementsByTagName(element);
for(var i=0,j=tr+1.length;i<j;i++)
{
tr[i].onmouseover=function(){
this.style.backgroundColor='#B9D5FF';
}
tr[i].onmouseout=function(){
this.style.backgroundColor='';
}
}
}
</script>
程序代码:<%
sheng=request("sheng")
shi=request("shi")
xian=request("xian")
gjz=request("gjz")
gs=request("gs")
page=Request("page")
px=request("px1")
if request("sheng")="省份" then sheng=""
if request("shi")="地级市" then shi=""
if request("xian")="市、县级市、县" then xian=""
if sheng="" and shi="" and xian="" and gjz="" and page="" and px="" and gs="" then
sql="SELECT * FROM fyd order by id desc"
else
sql="SELECT * FROM fyd where sheng like '%"&sheng&"%' and shi like '%"&shi&"%' and xian like '%"&xian&"%' and dz like'%"&gjz&"%' and gsmc like'%"&gs&"%' order by sheng "&px&", id desc"
end if
%>








