语法错误 (操作符丢失) 在查询php正则表达式语法 'news_class_id =' 中。 新闻中心出现这个问题, 我查了下 要有数值,

语法错误 (操作符丢失) 在查询表达式 &ID=& 中 怎么解决啊?
语法错误 (操作符丢失) 在查询表达式 &ID=& 中 怎么解决啊? 50
小弟新人也 &对语法还不熟 希望大家帮一下&%function WebMenu(ParentID,i,level)dim rs_1,sql_1set rs_1=server.CreateObject("adodb.recordset")sql_1="select * from ComSiteCMS_OthersSort where ID="&SortID1&rs_1.open sql_1,conn,1,1ParentID=rs_1("ParentID")& dim rs,sql& set rs = server.createobject("adodb.recordset")& sql="select * from ComSiteCMS_OthersSort where ViewFlag and Instr(SortPath,'"&ParentID&"')&0 and ParentID=0 order by ID asc"& rs.open sql,conn,1,1& do while not rs.eofIf ISHTML = 1 Then
AutoLink = ""&OtherName&""&Separated&""&rs("ID")&"."&HTMLName&"" Else
AutoLink = "OtherView.asp?ID="&rs("ID")&"" End If& & & & &response.write ""&rs("SortName")&""& & & & & & & &&& && & rs.movenext& loop& & if Instr(""&SortPath&"","0,14")&0 then& & & & &response.write "" & & & & & & & && end if& rs.close& set rs=nothing& & rs_1.close& set rs_1=nothingend function此代码打上了出现
你这个可以用Access自动生成SQL语句啊,新建查询向导,然后选择要查询的表和列就可以了.
提问者 的感言:我已经找到愿意了 不过还是谢谢! 满意答案
sql="select * from ComSiteCMS_OthersSort where ViewFlag and Instr(SortPath,'"&ParentID&"')&0 and ParentID=0 order by ID asc"SQL里不能用双引号,如里需要,要转义sql="select * from ComSiteCMS_OthersSort where ViewFlag and Instr(SortPath,'&ParentID&')&0 and ParentID=0 order by ID asc"&
&
或sql="select * from ComSiteCMS_OthersSort where ViewFlag and Instr(SortPath,'\"&ParentID&\"')&0 and ParentID=0 order by ID asc"
提问者 的感言:我已经找到愿意了 不过还是谢谢
等待您来回答
网页制作领域专家高手帮忙啊Microsoft JET Database Engine '80040e14' 语法错误 (操作符丢失) 在查询表达式 'id=' 中。
Microsoft JET Database Engine '80040e14' 语法错误 (操作符丢失) 在查询表达式 'id=' 中。 \news.asp, line 9这是文件代码&head&&meta http-equiv="Content-Type" content="text/ charset=gb2312" /&&%&set rs=server.CreateObject("adodb.recordset")&rs.open"select * from newsclass where id="&id&"",conn,1,1&& 提示这句错误 9&%&&title&&%=rs("n_type")%&-全部资讯-&%=Sitetitle%&&/title&&meta name="Keywords" content="&%=Sitekeywords%&" /&&meta name="Description" content="&%=Sitedescription%&" /&&link rel=&stylesheet& type=&text/css& href=& & /&&link rel=&stylesheet& type=&text/css& href=& & /&&link rel=&stylesheet& type=&text/css& href=& & /&&link rel=&stylesheet& type=&text/css& href=& & /&&SCRIPT src="/images/funcjs.js" type=text/javascript&&/SCRIPT&&style type="text/css"&&!--.STYLE5 {font-size: 16 font-weight: color: #000000; }.STYLE6 {&color: #9F0100;&font-weight:}.STYLE7 {&font-size: 16&color: #000000;&font-weight:}.STYLE8 {&font-size: 14&font-weight:&color: #CCCCCC;}--&&/style&&/head&&body&&%set rs=server.CreateObject("adodb.recordset")%&
不区分大小写
送一朵小红花感谢TA[Microsoft][ODBC Microsoft Access 驱动程序] 语法错误 (操作符丢失) 在查询表达式 &id =& 中。
[Microsoft][ODBC Microsoft Access 驱动程序] 语法错误 (操作符丢失) 在查询表达式 &id =& 中。 15
代码如下:
&%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%&&!--#include file="Connections/conn.asp" --&&%Dim Rs_logcontent__MMColParamRs_logcontent__MMColParam = "1"If (Request.QueryString("id") && "") Then & Rs_logcontent__MMColParam = Request.QueryString("id")End If%&&%Dim Rs_logcontentDim Rs_logcontent_cmdDim Rs_logcontent_numRows
Set Rs_logcontent_cmd = Server.CreateObject ("mand")Rs_logcontent_cmd.ActiveConnection = MM_conn_STRINGRs_mandText = "SELECT * FROM blogcontent WHERE id = ? ORDER BY id DESC" Rs_logcontent_cmd.Prepared = trueRs_logcontent_cmd.Parameters.Append Rs_logcontent_cmd.CreateParameter("param1", 5, 1, -1, Rs_logcontent__MMColParam) ' adDouble
Set Rs_logcontent = Rs_logcontent_cmd.ExecuteRs_logcontent_numRows = 0%&
if(request.QueryString("id") && "") then Command1_newnum = request.QueryString("id")
Set Command1 = Server.CreateObject ("mand")Command1.ActiveConnection = MM_conn_STRING<mandText = "UPDATE blogContent SET hitnum = hitnum+1 WHERE id =" & Command1_newnum<mandType = 1<mandTimeout = 0Command1.Prepared = trueCommand1.Execute()
%&&!DOCTYPE html PUBLIC &-//W3C//DTD XHTML 1.0 Transitional//EN& & &html xmlns=& &head&&meta http-equiv="Content-Type" content="text/ charset=gb2312" /&&title&无标题文档&/title&&link href="style.css" rel="stylesheet" type="text/css" /&&/head&
&body&&p&&&/p&&!--#include file="tou.asp" --&&table width="980" border="0" align="center" cellpadding="0" cellspacing="0" background="images/templatemo_content_bg.jpg"&& &tr&&&& &td&&&/td&& &/tr&&/table&&table width="980" border="0" align="center" cellpadding="0" cellspacing="0" background="images/templatemo_content_bg.jpg"&& &tr&&&& &td&&table width="580" border="0" align="center" cellpadding="5" cellspacing="5" class="biao"&&&&&& &tr&&&&&&&& &td align="center" class="rzbiaoti"&&%=(Rs_logcontent.Fields.Item("title").Value)%&&/td&&&&&& &/tr&&&&&& &tr&&&&&&&& &td align="right" class="rzshijian"&&%=(Rs_logcontent.Fields.Item("time").Value)%&&/td&&&&&& &/tr&&&& &/table&&&&&& &&&&& &table width="580" border="0" align="center" cellpadding="5" cellspacing="5"&&&&&&&& &tr&&&&&&&&&& &td class="rzneirong"&&%=(Rs_logcontent.Fields.Item("content").Value)%&&/td&&&&&&&& &/tr&&&&&& &/table&&/td&& &/tr&&/table&
&!--#include file="wei.asp" --&&/body&&/html&&%Rs_logcontent.Close()Set Rs_logcontent = Nothing%&
出现这样的错误:
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14'
[Microsoft][ODBC Microsoft Access 驱动程序] 语法错误 (操作符丢失) 在查询表达式 'id =' 中。
/logshow_content.asp,行 39
行 39 就是:Command1.Execute()
如果删掉就可以显示网页,但是没有单击后增加1次点击数的效果。
求高高手帮忙解决问题。可以再加20分
应该是id没有传值。即id = "",导致command1的SQL是:UPDATE blogContent SET hitnum = hitnum+1 WHERE id =当然要报错了!建议跟踪调试,或者把request.QueryString("id")打出来看看!
要怎么试?能不能详细点。谢谢
可以在VS中调试,通过加来执行到该语句时,的值。还可以使用response.write(request.QueryString("id"))把这个值输出到页面。
我没装VS没办法调试。有没有什么办法可以解决
的感言:我自己解决了,谢谢
等待您来回答
编程领域专家您还未登陆,请登录后操作!
语法错误 (操作符丢失) 在查询表达式 &#39;&#39;n_id&#39;=&#39; 中。
id=request("newsid") 这里没有获取到值,也就是你的id为空,你可以输出一下试试 response.write "参数为:" & id response.end 你的程序应该改进一下 &%id=request("newsid") if trim(id)="" then response.write "没能获取到参数newsid" response.end else if not isnum(id) then response.write "错误,参数不是数字" response.end end if end if sql="select * from t_news where n_id="&id Set rst = Server.CreateObject("ADODB.Recordset") rst.open sql,nconn,1,1 if rst.eof and rst.bof then response.Write(" 没有找到相关记录") response.End() end if%&上面改进后的已经是正确的了,具体参数形式是浏览器地址应该为这种形
id=request("newsid") 这里没有获取到值,也就是你的id为空,你可以输出一下试试 response.write "参数为:" & id response.end 你的程序应该改进一下 &%id=request("newsid") if trim(id)="" then response.write "没能获取到参数newsid" response.end else if not isnum(id) then response.write "错误,参数不是数字" response.end end if end if sql="select * from t_news where n_id="&id Set rst = Server.CreateObject("ADODB.Recordset") rst.open sql,nconn,1,1 if rst.eof and rst.bof then response.Write(" 没有找到相关记录") response.End() end if%&上面改进后的已经是正确的了,具体参数形式是浏览器地址应该为这种形式:你的页面.asp?newsid=数字比如:showNews.aspx?newsid=10如果后面没有数字,那么,你看看你的链接是不是做错了,有数字才能获取到值,才能传递给Sql语句正确的值。
您的举报已经提交成功,我们将尽快处理,谢谢!语法错误(操作符丢失)在查询表达式‘G_ID=’中
[问题点数:20分,结帖人sasukenaruto123]
语法错误(操作符丢失)在查询表达式‘G_ID=’中
[问题点数:20分,结帖人sasukenaruto123]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
相关帖子推荐:
2008年11月 总版技术专家分月排行榜第三2008年5月 总版技术专家分月排行榜第三2008年3月 总版技术专家分月排行榜第三
2009年3月 Web 开发大版内专家分月排行榜第一2009年2月 Web 开发大版内专家分月排行榜第一2008年11月 Web 开发大版内专家分月排行榜第一2008年7月 Web 开发大版内专家分月排行榜第一2008年6月 Web 开发大版内专家分月排行榜第一2008年5月 Web 开发大版内专家分月排行榜第一2008年4月 Web 开发大版内专家分月排行榜第一2008年3月 Web 开发大版内专家分月排行榜第一2008年2月 Web 开发大版内专家分月排行榜第一
2011年6月 Web 开发大版内专家分月排行榜第二
本帖子已过去太久远了,不再提供回复功能。}

我要回帖

更多关于 php正则表达式语法 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信