hi everyone i'm havin a problem with selecting data from two tables in a single database. i have a login page that looks like this
login.cfm
Code:
<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 this
index.cfm
Code:
<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 any help will be highly appreciated. thanks