Error with query compairing form entry.
Hello;
I wrote a small log in and it is giving me a problem. I use this all the time, and can't figure out why now on a different server it's giving me a hard time.I get an error when I submit the log in form. I can't figure out what I missed and why it decided to give me a problem now.
this is my error:
Error Executing Database Query. | ||||||||
| [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 3. | ||||||||
| The error occurred in C:\website\admin\LoginCheck.cfm: line 13 Called from C:\website\admin\index.cfm: line 7 Called from C:\website\admin\LoginCheck.cfm: line 13 Called from C:\website\admin\index.cfm: line 7 | ||||||||
11 : FROM adminUser 12 : WHERE userName =<cfqueryparam cfsqltype="cf_sql_varchar" value="#FORM.userLogin#"> 13 : AND password =<cfqueryparam cfsqltype="cf_sql_varchar" value="#FORM.userPassword#"> 14 : </CFQUERY> 15 : | ||||||||
| ||||||||
This is that block of code from the form to the LoginCheck.cfm block of code.
Form:
<cfif isDefined ("FORM.UserLogin")>
<cfinclude template="LoginCheck.cfm">
</cfif>
<cfform action="#CGI.SCRIPT_NAME#?#CGI.QUERY_STRING#" method="post" name="LoginForm">
<cfinput type="hidden" name="userLogin_required">
<cfinput type="hidden" name="userPassword_required">
<cfinput type="Text" name="userLogin"> <!--- there is more to these form fields, I just left it off for now to shortn the code--->
<cfinput type="Password" name="userPassword">
<cfinput name="Submit" value="Login" >
</cfform>
LoginCheck.cfm page:
<cfparam name="FORM.userLogin" type="string">
<cfparam name="FORM.userPassword" type="string">
<CFQUERY NAME="IsValidLogin" datasource="#APPLICATION.dataSource#">
SELECT adminUser.Fname, adminUser.Lname
FROM adminUser
WHERE userName =<cfqueryparam cfsqltype="cf_sql_varchar" value="#FORM.userLogin#">
</CFQUERY>
<CFQUERY NAME="IsValidUser" datasource="#APPLICATION.dataSource#">
SELECT adminUser.id, adminUser.Fname, adminUser.Lname, adminUser.isAdminstrator, adminUser.userName, adminUser.password
FROM adminUser
WHERE userName =<cfqueryparam cfsqltype="cf_sql_varchar" value="#FORM.userLogin#">
AND password =<cfqueryparam cfsqltype="cf_sql_varchar" value="#FORM.userPassword#">
</CFQUERY>
this IsValidUser is the one throwing the error. I have gone over this a million times and don't see what I did wrong. Can anyone see what I might be missing?
Thank you
