Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts

    'Update' not executing.

    Okay I have a mysql database (of course.. ) and when I run the 'update' command it doesn't seem to actually do it. It doesn't come back with any errors either.

    Here is my code... its ASP btw.
    Code:
          		set checkedIn = lpSQL.Execute("select * from CheckIn where picked='0';")
    			If checkedIn.EOF then
    				errAll="1"
    			else
    			Dim Guests(1000)
    			Dim GID(1000)
    			Dim x
    			x=1
    			Do while not checkedIn.EOF
    			
    			Guests(x)=checkedIn("Name")
    			GID(x)=checkedIn("ID")
    			
    			x=x+1
    			
    			checkedIn.MoveNext
    			Loop
    			
    			Dim Final
    			Randomize
    			
    			Do
    			Final=Int((x - 1 + 1) * Rnd + 1)
    			If not Guests(Final)="" then exit do
    			Loop
    			lpSQL.Execute("UPDATE CheckIn SET picked=1 WHERE Name=' & Guests(Final) & ';")
    The red line is the sql query i'm talking about. So what am I doing wrong?
    OracleGuy

  • #2
    New Coder
    Join Date
    Nov 2002
    Location
    Netherlands
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Now I need to brush up on my ASP so I could easily be wrong but shouldn't that line be:

    lpSQL.Execute("UPDATE CheckIn SET picked=1 WHERE Name='" & Guests(Final) & "';")

  • #3
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    OMG! Thanks so much. I can't believe I didn't see that! Strange that it didn't give me an error. Thats what I get for working so late at night.
    OracleGuy

  • #4
    New Coder
    Join Date
    Nov 2002
    Location
    Netherlands
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Good to hear that that solved the problem. And well sintactically (is that a word) it is correct.


  •  

    Posting Permissions

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