Guest User

Untitled

a guest
May 13th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 1.26 KB | None | 0 0
  1. <%
  2. Dim player1, player2, st_hand1, p1score
  3. Dim sConnString, connection, sSQL
  4.  
  5. '------------db Connect-------'
  6. Set conn = Server.CreateObject("ADODB.Connection")
  7. conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=db396776384.db.1and1.com;UID=dbo396776384;PWD=flashcs3;DATABASE=db396776384"
  8.  
  9.  
  10.     player1 = Request.Form("name1")
  11.     player2 = Request.Form("name2")
  12.    
  13.     points1 = session("points1")
  14.  
  15.     st_hand1 = Request.Form("st_hand1")
  16.  
  17.     if points1 = "" then points1 = "0"
  18.     if points1 <> "" then points1 = points1
  19.  
  20.  
  21. '----------Find Game----------'
  22.     fp_sQry = "SELECT scoreboard.player1, scoreboard.player2 FROM scoreboard WHERE scoreboard.player1 = '" & player1 & "' and scoreboard.player2 = '" & player2 & "'"
  23.    
  24.     Set rs = conn.Execute(fp_sQry)
  25.    
  26.     if rs.EOF and rs.BOF then '----INSERT----
  27.    
  28.      sSQL = "INSERT into scoreboard (player1, player2, st_hand1) values ('" & player1 & "', '" & player2 & "', '" & sthand1 & "')"
  29.      Set urs = conn.Execute(sSQL)
  30.      urs.Close
  31.     else '----------UPDATE ------------'
  32.  
  33.      sSQL = "UPDATE scoreboard SET st_hand1 = '" & st_hand1  & "'" &  WHERE scoreboard.player1 = '" & player1 & "' and scoreboard.player2 = '" & player2
  34.      Set irs = conn.Execute(sSQL)
  35.      irs.close
  36.     end if
  37.  
  38. rs.close
  39. conn.close
  40. Response.Redirect ("results.asp")
  41. %>
Add Comment
Please, Sign In to add comment