...

View Full Version : 'Update' not executing.



oracleguy
11-28-2002, 02:18 AM
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.


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?

Wichetael
11-28-2002, 08:59 AM
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) & "';")

oracleguy
11-28-2002, 09:17 AM
OMG! Thanks so much. :thumbsup: 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.

Wichetael
11-28-2002, 10:12 AM
Good to hear that that solved the problem. And well sintactically (is that a word) it is correct.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum