954,123 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Check new UserID - if taken or not

Hey all,

I’ve created a register form that includes some Dreamweaver generated code and code of my own. What I did was within the main query that handles the insert of the userID I added another query within the to see if the userID already exists. The problem is that when I test the form it goes no where, just keeps thinking.

The dark orange is where i believe I have the problem.

Here is the my query code;


INSERT INTO tblWalyerMembers (UserID, Password, Date, Email)
VALUES (

SELECT UserID
FROM tblWalyerMembers
WHERE UserID = '#FORM.UserID#'
*Your User Name is already taken by another User.*

'#FORM.userid#'

,

'#FORM.password#'

NULL

,

'#FORM.email#'

NULL

)

Any ideas will be great.

Take care,

Walyer

Walyer's Playpen

Walyer
Light Poster
28 posts since Apr 2005
Reputation Points: 10
Solved Threads: 1
 

*Update*

Now I've run into another problem. I changed the Code from above (dark red) by adding a . Now my problem (dark orange) is at the next of my INSERT queryand I get this error message "Error Executing Database Query". I'm still new to ColdFusion and the debugging so any ideas would be great.

code;


INSERT INTO tblWalyerMembers (UserID, Password, Email)
VALUES (

*Your must enter a User Name.*

SELECT UserID
FROM tblWalyerMembers
WHERE UserID = '%#FORM.UserID#%'
*Your User Name is already taken by another User.*

'#FORM.userID#'

,


'#FORM.password#'

NULL

,


'#FORM.email#'

NULL


)

Thank you to anyone that can help me,

Walyer

Walyer's Playpen

Walyer
Light Poster
28 posts since Apr 2005
Reputation Points: 10
Solved Threads: 1
 

Well I got it working, thanks for nothing. :D

I don't get it, I would think that someone could see what I did wrong or maybe it was too "advanced" for the users that post on this forum.

Knowledge = Power and i truly believe that knowledge should be passed on no matter how simple the question may seem. We all start off knowing nothing and we build from that.

If anyone would like to know how I did it just post.

Walyer
Light Poster
28 posts since Apr 2005
Reputation Points: 10
Solved Threads: 1
 

That seems pretty complicated. Here's a real simple one I use:



SELECT Username FROM Table WHERE Username = '#Form.Username#'
Ooops, the username has already been selected by another user. Please enter a new username

*Update*

Now I've run into another problem. I changed the Code from above (dark red) by adding a . Now my problem (dark orange) is at the next of my INSERT queryand I get this error message "Error Executing Database Query". I'm still new to ColdFusion and the debugging so any ideas would be great.

code;


INSERT INTO tblWalyerMembers (UserID, Password, Email)
VALUES (

*Your must enter a User Name.*

SELECT UserID
FROM tblWalyerMembers
WHERE UserID = '%#FORM.UserID#%'
*Your User Name is already taken by another User.*

'#FORM.userID#'

,


'#FORM.password#'

NULL

,


'#FORM.email#'

NULL


)

Thank you to anyone that can help me,

Walyer

Walyer's Playpen

paulbaylis
Newbie Poster
2 posts since Mar 2006
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You