Comparing Tables

Results 1 to 2 of 2

Thread: Comparing Tables

  1. #1
    Join Date
    Dec 1969

    Default Comparing Tables

    I am trying to do a online NFL office pool that will compare if you selected the right teams<BR><BR>the table is as follows<BR>User<BR>Game1<BR>Game2<BR>Game3<BR>ect to Game 16<BR><BR> var query2 = "SELECT * FROM NFLPicks WHERE User=&#039;" + user + "&#039;;";<BR> check = db.Execute(query2);<BR> <BR> var query = "SELECT * FROM NFLPicks WHERE User=&#039;ADMIN&#039;;";<BR> Result = db.Execute(query);<BR><BR>Both query&#039;s work and report the correct thing the problem I am having is comparing the two<BR><BR>&#060;%<BR> var Correct = 0;<BR> if(check("Game1") == Result("Game1"))<BR> Correct++;<BR>%&#062;<BR>&#060;%=Correct%&#062;<BR >This is pretty much what I am doing and no matter what I do it always reports back as 0<BR><BR>but when I do <BR>&#060;%<BR> var Correct = 0;<BR> if(check("Game1") == check("Game1"))<BR> Correct++;<BR>%&#062;<BR>&#060;%=Correct%&#062;<BR ><BR>Then it increases correct what is the difference anyone help

  2. #2
    Join Date
    Dec 1969

    Default So where's your debugging?

    &nbsp;<BR>Have you done something as simple as<BR> Response.Write( "check is " + check("Game1") )<BR> Response.Write( "result is " + result("Game1") )<BR><BR>Oh...I know!<BR><BR>In JS coding, <BR> check("Game1")<BR>is an *OBJECT*! And of course no two objects are ever identical unless they are the same object.<BR><BR>You need to do<BR> if ( check("Game1").value == Result("Game1").value) ...<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts