Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-28-2002, 02:18 AM   PM User | #1
oracleguy
Rockstar Coder


 
Join Date: Jun 2002
Location: USA
Posts: 9,043
Thanks: 1
Thanked 322 Times in 318 Posts
oracleguy is a jewel in the roughoracleguy is a jewel in the roughoracleguy is a jewel in the rough
'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
oracleguy is offline   Reply With Quote
Old 11-28-2002, 08:59 AM   PM User | #2
Wichetael
New Coder

 
Join Date: Nov 2002
Location: Netherlands
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Wichetael has a little shameless behaviour in the past
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) & "';")
Wichetael is offline   Reply With Quote
Old 11-28-2002, 09:17 AM   PM User | #3
oracleguy
Rockstar Coder


 
Join Date: Jun 2002
Location: USA
Posts: 9,043
Thanks: 1
Thanked 322 Times in 318 Posts
oracleguy is a jewel in the roughoracleguy is a jewel in the roughoracleguy is a jewel in the rough
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
oracleguy is offline   Reply With Quote
Old 11-28-2002, 10:12 AM   PM User | #4
Wichetael
New Coder

 
Join Date: Nov 2002
Location: Netherlands
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Wichetael has a little shameless behaviour in the past
Good to hear that that solved the problem. And well sintactically (is that a word) it is correct.
Wichetael is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:05 PM.


Advertisement
Log in to turn off these ads.