Jump to content
Sign in to follow this  
luckiano

problem with selection from two tables!

Recommended Posts

hi everyone i'm havin a problem with selecting data from two tables in a single databasei have a login page that looks like thislogin.cfm

<cfform action="index.cfm" method="post"><cfinput type="text" name="username"><cfinput type="text" name="password"><cfinput type="submit" name="submit"></cfform>

and the index.cfm page looks like thisindex.cfm

<cfquery name="qryrDe" datasource="mydsn>	SELECT UserName, password, surName, middleName	 FROM Users, results	WHERE UserName = <cfqueryparam value="#trim(form.Username)#" CFSQLType="CF_SQL_VARCHAR">	AND password = <cfqueryparam value="#trim(form.password)#" CFSQLType="CF_SQL_VARCHAR">  </cfquery>

it is always throwing an error that the username could be from any of the two tables. please help

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×