Thanks Deanna. Just a couple of questions (and problems).
The form which displays the check boxes does so with a loop getting a
list of the possible attributes:
<!--- find all attributes --->
<cfquery name="FindAttributes" datasource="user020">
SELECT attributeID, attributeName
FROM tbl_020publicAttributes
</cfquery>
<cfloop query="FindAttributes">
<cfinput type="checkbox"
name="attribute_#attributeID#" label="#attributeName#">
</cfloop>
And also, there don't necessarily have to be any attributes in the
table tbl_020publicProfilesAttributes for every profile as some may
not have changed their profile accordingly.
Also can you tell me, are the p and the a just references which could
be any letter? Oh yes, i'm using MS-SQL.
It was about a week ago when you suggested i should use this middle
join table instead and i never thought i'd get my head around it but
managed to create one and have it update (well, delete or create
rows) when users change their profiles. Now i'm up to the bit where
the searching is and this part has just stumped me a bit.
I am learning however... :) Albeit slowly.
Thanks,
On 15 Jul 2005, at 16:50, Deanna Schneider wrote:
> 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:212014
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54