B
Brett_A
Any reason why this code doesn't work? It doesn't generate any errors
but it doesn't update the data.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
on error resume next
'request variables
report_id = Request.querystring ("report_id")
ad_id = Request.querystring ("ad_id")
report_count = Request.querystring ("report_count")
'reduce report count
report_count = report_count - 1
'create connection
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "driver={SQL Server};server=xxxxxxxx"
'delete spam SQL
SQLstmt = "DELETE FROM tbl_reports WHERE report_id=" & report_id & ""
'update spam count SQL
SQLstmt1 = "UPDATE tbl_ads SET "
SQLStmt1 = SQLstmt1 & "report_count='" & report_count & "'"
SQLStmt1 = SQLStmt1 & " WHERE ad_id='" & ad_id & "'"
'execute SQL statements
Conn.execute "SQLstmt"
Conn.execute "SQLstmt1"
'close connection
Conn.close
Set Conn = nothing
'redirction
response.Redirect("alerts.asp")
%>
but it doesn't update the data.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
on error resume next
'request variables
report_id = Request.querystring ("report_id")
ad_id = Request.querystring ("ad_id")
report_count = Request.querystring ("report_count")
'reduce report count
report_count = report_count - 1
'create connection
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "driver={SQL Server};server=xxxxxxxx"
'delete spam SQL
SQLstmt = "DELETE FROM tbl_reports WHERE report_id=" & report_id & ""
'update spam count SQL
SQLstmt1 = "UPDATE tbl_ads SET "
SQLStmt1 = SQLstmt1 & "report_count='" & report_count & "'"
SQLStmt1 = SQLStmt1 & " WHERE ad_id='" & ad_id & "'"
'execute SQL statements
Conn.execute "SQLstmt"
Conn.execute "SQLstmt1"
'close connection
Conn.close
Set Conn = nothing
'redirction
response.Redirect("alerts.asp")
%>