I am trying to set up a simple table join. The code I am using is below:
<cfquery name="SelectedPeople" datasource="DatabaseTest1" dbtype="ODBC">
SELECT Main.Name, Main.Address, Main.Phone, Main.Wonderful, Groups.Name
FROM Main, Groups
WHERE Main.Name like '%#form.TheirName#%'
AND Main.GroupCode = Groups.GroupCode
<cfif SelectedPeople.RecordCount is "0">
No results matched your search criteria
But are they wonderful?
<CFIF #Main.Wonderful# is 1>
When I run this, coldfusion reports:
Error resolving MAIN.NAME
ColdFusion was unable to determine the value of the parameter
I have set up the database source, and tried it successfully without the extra Groups table, and it has run fine, and when I submit the form that feeds into this with the TheirName field set to nothing, it returns all three records. Both tables have records, and all the records in the Main table have a record in the Groups table with the same ID. Also, when I try getting the RecordCount for this query, it returns three. So what am I doing wrong?
P.S I know the fields look ridiculous, but this is just a practice exercise, to learn ColdFusion