Ask a Question related to Coldfusion Database Access, Design and Development.
-
KevCB #1
Compass Travel example search not working
Hi
I seem to be having a problem copying the example Compass Travel application
in the pdf files.
When I've copied the code to create the first part of the search with the
tripLocation as the WHERE clause in the query.
When running the search with selecting the begins with from the select box and
using C, it brings back absolutely nothing.
Yet if I run the search selecting is and type in China, it brings back the one
record like it says in the PDF file.
It seems as if the query isn't running the wildcard for the begins with
search, when running through the examples has anyone encountered this problem,
or know why this is happening?
Thanks
Here's my function in the CFC:
<cffunction name="getTripsFromForm" output="false" access="public"
returntype="query">
<!--- Create WHERE clause from data entered via search form --->
<cfset WhereClause = " 0=0 ">
<!--- Build subclause for trip location --->
<cfif Form.tripLocationOperator GT "">
<cfif Form.tripLocationOperator EQ "EQUALS">
<cfset WhereClause = WhereClause & " and tripLocation = '" &
form.tripLocationValue & "'">
<cfelse>
<cfset WhereClause = WhereClause & " and tripLocation = '" &
form.tripLocationValue & "%'">
</cfif>
</cfif>
<cfquery name="TripResult" datasource="CompassTravel">
SELECT tripID, tripName, tripLocation, departureDate, returnDate, price
FROM trips
WHERE #PreserveSingleQuotes(WhereClause)#
</cfquery>
<cfreturn TripResult>
</cffunction>
KevCB Guest
-
In search of working IM library
I provide information via email to several clients, and in many cases it would be better to use an instant messanger like MSN, Yahoo, or AIM. My... -
3 field search not working
I have a 3 field search http://www.websitemedia.net/demo/7665/without_fl/qualitymotorsdemo.cfm The 3 fields work great individually. But i am... -
How to make a 3D compass
i'm trying to make a 3d compass. the needle will correspond to the movement of the camera. my idea was to get the value of the z axis rotation of... -
Compass rose
Could anybody help me solving the following task: In my project a user can navigate through a 3D landscape scene. I want to design a compass rose... -
Help search not working version 4.0
hi since i reinstalled XP the help search applet is not loading... status bars says "version 4 browser and java required" i have MS java VM... -
KevCB #2
Re: Compass Travel example search not working
Doesn't matter now, I missed out the 'Like' in the WHERE clause.
It should have been:
<cfset WhereClause = WhereClause & " and tripLocation Like '" & form.tripLocationValue & "%'">
KevCB Guest



Reply With Quote

