PDA

View Full Version : Getting the name to show up


Crash1hd
05-01-2003, 05:41 AM
I am having trouble getting the name value to show up the value is First_Name

Sub ConfirmRegistration() ''''''''''''''''''''''''
Dim ConfirmQuery
ConfirmQuery = "SELECT userid FROM members WHERE userid = " & confirm
Set rs = Conn.Execute(ConfirmQuery)
If NOT rs.EOF Then
Dim UpdateConfirmedStatus
UpdateConfirmedStatus = "UPDATE members SET confirmed = True WHERE userid = " & confirm
Conn.Execute(UpdateConfirmedStatus)
response.write("<p align=center><b>Thankyou "& (First_Name) & " for registering click <a href=default.asp>here</a> to login</b></p>")
Else
emailfound = False ' The email was not found, they still need to register
End If
End Sub ''''''''''''''''''''''''''''''''''''''''''

not sure how to make it work! this page comes up after someone clicks on a link in an email! in the red

also if there is a way to make the userid changed to username or email if that would be possible so that when the user clicks the link in the email to confirm there subscription its not a number that does the verification but a word! in the blue

Thanks in advance

ecnarongi
05-02-2003, 05:11 PM
you have to reference the first name field from an object.

change this line

response.write("<p align=center><b>Thankyou "& (First_Name) & " for registering click <a href=default.asp>here</a> to login</b></p>")

to this

response.write("<p align=center><b>Thankyou "& rs(First_Name) & " for registering click <a href=default.asp>here</a> to login</b></p>")

if this is not what you are looking for let me know. Plus I don't quite understand your second question. Clarify for me a little. :thumbsup:

oracleguy
05-02-2003, 07:01 PM
Additionally you need to add First_Name in your select statement so that it pulls that information from the database.

And also you should do it like rs.Fields("First_Name").Value But if you do it the way ecnarongi suggested, it works too but it isn't as efficent because it takes longer to process and you can't do it like rs(First_Name) because then it thinks First_Name is a variable that holds the field name that you want. You need to add quotes around it like rs("First_Name") and then it will work.

ecnarongi
05-02-2003, 09:51 PM
:thumbsup: the little things like quotes will get you. thanks oracleguy

Crash1hd
05-07-2003, 07:43 AM
Sorry for the late reply! Big family trouble I just wanted to thankyou all for your help I figured out where i went wrong lol I had the following

Set RS = Conn.Execute("SELECT userid FROM members WHERE userid = " & confirm")

where it should be

Set RS = Conn.Execute("select * from members")

that way everything gets selected lol!

I was just wondering what is the difference between rs("user") and rs.fields("user")???