Depends on what you want it to do. Right now, it's saying, select this stuff
if town is the same as the form.towny  AND category is form.category OR
select this stuff if natpaid is yes and nationwide is yes AND category is
form.category.

My guess is that what you want is:
select this stuff if town is the same as the form.towny OR select this stuff
if natpaid is yes and nationwide is yes AND category is form.category.

If that's what you want, you need a little different query. Try this:

<cfquery cachedwithin="#createtimespan(0,0,10,0)#" name="getads"
datasource="#DSN#">
SELECT left(subject,20) as newsubject, * FROM advert_details
WHERE town = '#form.towny#'
<cfif isdefined('form.category')>
OR (natpaid = Yes AND nationwide = Yes
AND category = '#form.category#')
<cfelse>
OR (natpaid = Yes AND nationwide = Yes)
</cfif>
</cfquery>

Make sense?
-Deanna


Deanna Schneider
Interactive Media Developer
[EMAIL PROTECTED]


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to