php mysql执行delete删除未存在的记录为什么会提示成功

版权声明: https://blog.csdn.net/LPLIFE/article/details/80349081


对于mysql来说,进行delete语句,无论符合删除条件的条数为多少,即使0条结果,只要成功执行了delete语句,mysql就会返回真,所以php也会提示成功。

记录记录问题 执行删除提示成功但是记录没被删掉

03-11

rnrnrn<% rnDim Rs,SQL,PageNo,ThePage,Psize,PCount,RCountrnDim Action,Param,ParamNamernCity = Session("Web_eCity")rnAction = Request.QueryString("action")rnNcid = Request.QueryString("ncid")rnSelect Case Actionrn Case "flag"rn Call Flag_Submit() '//评比或者通过审核函数rn Case "del"rn SQL = "Delete from [pH_Web_Ad] where Ncid = '"&Ncid&"'"rn Conn.execute(SQL)rn Response.write " "rnEnd Selectrn'//获取参数rnParamName = Replace_Text(Request("ParamName"))rn'//查找企业表所有记录rnSet Rs = Server.Createobject("ADODB.recordset")rn'//组织查询语句rnIf ParamName = "" Thenrn SQL = "Select * From [pH_Web_Ad]"' Where City="&City&""rnElsern SQL = "Select * From [pH_Web_Ad] Where AdName Like '%"&ParamName&"%' "'And City="&City&""rnEnd ifrnSQL = SQL&" Order By WebName Asc"rnRs.Open SQL,Conn,1,1rnRs.Pagesize = 10rnPsize = Rs.PageSizernPCount = Rs.PageCountrnRCount = Rs.RecordCountrnPageNo = Cint(Request.QueryString("PageNo"))rnIf PageNo < 1 Thenrn PageNo = 1rnElseif PageNo > PCount Thenrn PageNo = PCountrnEnd ifrnThepage = (PageNo-1)*PsizernIf Not Rs.Eof Then Rs.AbsolutePage = PageNo%>rn rn rnrn ::广告管理rn 添加广告rnrn rn rn rn 共<%= RCount %>条 分<%= PCount %>页 | 当前第<%= PageNo %>页rn rn<%rn If PageNo > 1 Thenrn Response.write "首页 "rn Response.write "上页 " rn Elsern Response.write "首页 "rn Response.write "上页 " rn End ifrn %>rnrn<% For i = 1 to PCount %>rn><%=i%>rn<% Next %> rn<% rn If PageNo < PCount Thenrn Response.write "下页 "rn Response.write "尾页" rn Elsern Response.write "下页 "rn Response.write "尾页" rn End if%> rn rn rn 编号rn 广告位置名称rn 文件类型rn 开始日期rn 截止日期rn 排序rn 缩略图rn 管理操作rn rn<% rn For i = 1 to Psizern If Rs.Eof Then Exit Forrn Ncid = Rs("Ncid")rn AdName = Rs("AdName")rn WebName = Rs("WebName")rn AdClass = Rs("AdClass")rn BeginDate = Rs("BeginDate")rn EndDate = Rs("EndDate")rn Sort1 = Rs("Ad_Sort")rn AdFile = Rs("AdFile") rn '广告所在页面rn Select Case WebNamern Case 1:WebName_Str = "首页"rn Case 2:WebName_Str = "个人求职"rn Case 3:WebName_Str = "企业招聘"rn Case 4:WebName_Str = "视频简历"rn Case 5:WebName_Str = "视频面试"rn Case 6:WebName_Str = "人才评测"rn Case 7:WebName_Str = "高校就业"rn Case 8:WebName_Str = "人力资讯"rn Case 9:WebName_Str = "培训频道"rn Case 10:WebName_Str = "企业内容页"rn End Selectrn '文件类型rn Select Case AdClassrn Case 1:AdClass_Str = "图片文件"rn Case 2:AdClass_Str = "Flash文件"rn End Select%>rn rn <%= ThePage+i %>rn <%= AdName %>rn <%= AdClass_Str %>rn <%= BeginDate %>rn <%= EndDate %>rn <%= Sort1 %>rn <% If AdClass = 1 Then %> " target="_blank">" width="100" height="30" border="0"> rn<% Else %> rn">rnrn" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="435" height="75"> rn <% End if %> rn 编辑 rn name="ncid">rn<% rnRs.Movenext rnNextrn %>rn 快速搜索 rnrnrn rnrnrn rn rn rnrn<%rnRs.ClosernSet Rs = NothingrnCall CloseDB()rn%>

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试