View Single Post
 
Old June 3rd, 2006, 06:06 PM
myself myself is offline
Authorized User
 
Join Date: May 2006
Location: Bradford, , United Kingdom.
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default 2 SQL's possible with an IF?

I am tryimg to execute one of the following codes, based on an if statement:
<%
  wpage = request.ServerVariables("HTTP_REFERER")
  If wpage = "form1.asp" Then
  mySQL = "INSERT INTO tbl_team (tName, tSurname, tAge")
  mySQL = mySQL & " VALUES ('" & request.form("tName") & "','" & request.form("tSurname") & "','" & request.form("tAge") & "')"
  myRS.Open mySQL, myCon,3,3
  myCon.execute(mySQL)
  ELSE
  mySQL = "INSERT INTO tbl_help (hName, hSurname, hAge")
  mySQL = mySQL & " VALUES ('" & request.form("hName") & "','" & request.form("hSurname") & "','" & request.form("hAge") & "')"
  myRS.Open mySQL, myCon,3,3
  myCon.execute(mySQL)
  End if
  %>

I seem to receive an error:
Number of query values and destination fields are not the same.
Anyone know where am I going wrong? Hope to hear.