You might be able to speed up the query and get it to work if you make a few
minor changes.
In the form instead of :
marketplace.cfm?request=cat
marketplace.cfm?request=twn
marketplace.cfm?request=alpha

change it so the options are:
marketplace.cfm?request=category
marketplace.cfm?request=town
marketplace.cfm?request=busname

Then in the marketplace.cfm file make these changes:
<CFPARAM NAME="URL.request" DEFAULT="category">

<CFQUERY NAME="GetResults" DATASOURCE="Reminder">
SELECT * FROM customer
ORDER BY #URL.request#
</CFQUERY>

The CFPARAM ensures that there is a value for the url.request variable
(prevents errors) and the change to the CFQUERY means that it doesn't have
to evaluate 3 CFIFs.

If for some strange reason you can't do this, then to correct your original
code, change <CFIF request = to <CFIF request IS

Steven Durette
MGR. - Engineering & Construction System Support
Database Administrator/Web Developer
Ameritech/SBC
(810)466-7654 [Office]
[EMAIL PROTECTED] [work email]
[EMAIL PROTECTED] [work email]

----- Original Message -----
From: "Jeffrey Cohen" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Sunday, September 09, 2001 2:11 AM
Subject: Newbie Syntax Help


> Help!!! Please!!!
> OK..I'm new at this, so be kind...
>
> I have a pulldown menu, that returns a URL like:
>
> marketplace.cfm?request=cat
> marketplace.cfm?request=twn or
> marketplace.cfm?request=alpha
>
> Then, in marketplace.cfm, I am trying to ORDER BY the variable above, like
>
>
> <CFQUERY NAME="GetResults" DATASOURCE="Reminder">
> SELECT * FROM customer
> <cfif request = cat>order by category</cfif>
> <cfif request = twn>order by town</cfif>
> <cfif request = alpha>order by busname</cfif>
> </CFQUERY>
>
>
> Of course, this blows up! (CAT is Undefined...), even though debugging
tell
> me URL parameters request=cat. How am I supposed to pass a variable from a
> url to my sql query???
>
> Thanks in advance!
>
> Jeffrey
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to