
September 9th, 2004, 05:51 AM
|
 |
Contributing User
|
|
Join Date: Jun 2004
Location: Somewhere only we know...
|
|
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
|