Try this. I'm not sure which DB, or if all users are requred to select
the type of match they seek. So, you may need to use the SQL Server
join syntax or the outer join syntax, if matching that parameter is
optional.
<cfquery name="FindMatches" datasource="user020">
SELECT profileID, userID, profileTitle, gender,
genderSeeking, screenName, location, locationID, locationName, age,
confirmationID, imageName, imageAuthorisation
FROM tbl_020publicProfiles p,
tbl_020publicLocations,tbl_020publicProfilesAttributes a
WHERE gender = '#form.genderSeeking#' AND genderSeeking =
'#form.gender#' AND confirmationID = 'yes' AND userID <>
<cfqueryparam value='#Client.KissMyDate_UserID#'
cfsqltype="cf_sql_integer" maxlength="4"> AND
tbl_020publicLocations.locationID =
tbl_020publicProfiles.location<cfif isDefined('form.location') and
form.location neq 0> AND location = '#form.location#'</cfif><cfif
isDefined('form.minAge') and form.minAge neq 0> AND age >=
#form.minAge#</cfif><cfif isDefined('form.maxAge') and form.maxAge
neq 0> AND age <= #form.maxAge#</cfif><cfif isDefined
('form.hasPhotograph') and form.hasPhotograph eq 1> AND
imageAuthorisation = 1</cfif>
AND p.profileid = a.profileid
AND a.attributeid IN (<cfqueryparam cf_sql_type="integer"
value="#form.attributeid#" list="yes")
ORDER by confirmationDate DESC
</cfquery>
On 7/15/05, Saturday (Stuart Kidd) <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> I'm working on the search page of a dating application.
>
> In the form where the user gets to choose his/her preferred partner
> there are a few checkboxes which says:
>
> I am searching for:
>
> Love
> Casual
> Travel mate
> Friend
>
> When displayed as checkboxes i'm pulling from a table called
> tbl_020publicAttributes (fields: attributeID, attributeName).
>
> All users with profiles on the site have their attributes in a join
> table called tbl_020publicProfilesAttributes (fields profileID,
> attributeID)
>
> So when a visitor comes to the site and fills out a search form i
> want the results to also include the stated type of attributes they
> are looking for.
>
> So far my form works but i have no idea how i am going to also
> include this other table tbl_020publicProfilesAttributes:
>
> <cfquery name="FindMatches" datasource="user020">
> SELECT profileID, userID, profileTitle, gender,
> genderSeeking, screenName, location, locationID, locationName, age,
> confirmationID, imageName, imageAuthorisation
> FROM tbl_020publicProfiles, tbl_020publicLocations
> WHERE gender = '#form.genderSeeking#' AND genderSeeking =
> '#form.gender#' AND confirmationID = 'yes' AND userID <>
> <cfqueryparam value='#Client.KissMyDate_UserID#'
> cfsqltype="cf_sql_integer" maxlength="4"> AND
> tbl_020publicLocations.locationID =
> tbl_020publicProfiles.location<cfif isDefined('form.location') and
> form.location neq 0> AND location = '#form.location#'</cfif><cfif
> isDefined('form.minAge') and form.minAge neq 0> AND age >=
> #form.minAge#</cfif><cfif isDefined('form.maxAge') and form.maxAge
> neq 0> AND age <= #form.maxAge#</cfif><cfif isDefined
> ('form.hasPhotograph') and form.hasPhotograph eq 1> AND
> imageAuthorisation = 1</cfif>
> ORDER by confirmationDate DESC
> </cfquery>
>
> Any help i'd be very grateful with.
>
> Thanks,
>
> Saturday
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212008
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54