SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 9th, 2004, 05:51 AM
richyrich's Avatar
richyrich richyrich is offline
Contributing User
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Somewhere only we know...
Posts: 4,192 richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)  Folding Points: 126743 Folding Title: Super Ultimate Folder - Level 1Folding Points: 126743 Folding Title: Super Ultimate Folder - Level 1Folding Points: 126743 Folding Title: Super Ultimate Folder - Level 1Folding Points: 126743 Folding Title: Super Ultimate Folder - Level 1Folding Points: 126743 Folding Title: Super Ultimate Folder - Level 1Folding Points: 126743 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 1 Week 1 Day 19 h 56 m 39 sec
Reputation Power: 1209
Unhappy Problems with SQL Update

Hi All

I'm running a two page registration form to allow couples to register and reference between the two. I'm using the primary key, visitorref, which is drawn out into a session variable when Applicant 1 registers. They're then taken to the 2nd Applicant form. When they register, I want the coupleref field for applicant 1 to be updated with the visitorref from applicant 2 and vice versa.

These are my SQL statements

strsql="UPDATE visitors SET coupleref='"&session.Contents("visitorref")&"' WHERE visitorref='"&session.Contents("visitor2ref")&"'"
conn.Execute(strsql)
strsql="UPDATE visitors SET coupleref='"&session.Contents("visitor2ref")&"' WHERE visitorref='"&session.Contents("visitorref")&"'"
conn.Execute(strsql)

When I run the script though the fields are not updating, but I get no error message. Both the fields are integers, so I tried removing the single quotes, but that gave an error message.

Can anyone point out my error?

Annoyingly, I was running an Access database and had no problems, but have changed it to run on MySQL and am now trying to rewrite most of my insert/update scripts into SQL.

Any help would be great!

Thanks

Reply With Quote
  #2  
Old September 9th, 2004, 07:16 AM
richyrich's Avatar
richyrich richyrich is offline
Contributing User
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Somewhere only we know...
Posts: 4,192 richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)richyrich User rank is General 4th Grade (Above 100000 Reputation Level)  Folding Points: 126743 Folding Title: Super Ultimate Folder - Level 1Folding Points: 126743 Folding Title: Super Ultimate Folder - Level 1Folding Points: 126743 Folding Title: Super Ultimate Folder - Level 1Folding Points: 126743 Folding Title: Super Ultimate Folder - Level 1Folding Points: 126743 Folding Title: Super Ultimate Folder - Level 1Folding Points: 126743 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 1 Week 1 Day 19 h 56 m 39 sec
Reputation Power: 1209
Sorry Guys...

Have found the problem...I'd named the session variable incorrectly and it was returning 0.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Problems with SQL Update


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT