Very good, just the type of help I was looking for.
Is that an SQL thing or a cold fusion thing?  I was wondering what the %
sign was for LOL.  


-----Original Message-----
From: Brian Ledwith [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 26, 2002 1:32 PM
To: CF-Talk
Subject: RE: New User

You might want to plug that "%" back in, as Scott Brady mentioned.
Using his "WHERE Title LIKE '%dog%'" example, if you take out the
leading "%", the word "hotdog" wouldn't be returned, and I think you
would want it to.  On your site, if I search for "grass" I get nothing,
but if I search for "blue", I get a number of results.  See what I mean?
 
With the leading and trailing "%", i.e. WHERE Title LIKE '%dog%'
        Hotdog, hotdogs, and dog and dogs would be returned

With just the trailing "%", i.e. WHERE Title LIKE 'dog%'
        Dog and dogs would be returned, but not hotdog or hotdogs

With just the leading "%", i.e. WHERE Title LIKE '%dog'
        Dog and hotdog would be returned, but not hotdogs or dogs

HTH,
~bgl

--> -----Original Message-----
--> From: Mike Miessen [mailto:[EMAIL PROTECTED]]
--> Sent: Thursday, December 26, 2002 10:15 AM
--> To: CF-Talk
--> Subject: RE: New User
--> 
--> I took out the leading % and I dropped the ?TITLE from the action on
the
--> process button and my query now works.  Thanks to you guys :)
--> 
--> -----Original Message-----
--> From: Clint Tredway [mailto:[EMAIL PROTECTED]]
--> Sent: Thursday, December 26, 2002 12:07 PM
--> To: CF-Talk
--> Subject: Re: New User
--> 
--> Take out the leading % and your query will work. With both % in
there
--> this
--> returns everything because to SQL, your string is like everything in
the
--> database.
--> 
--> HTH,
--> Clint
--> 
--> ----- Original Message -----
--> From: "Mike Miessen" <[EMAIL PROTECTED]>
--> To: "CF-Talk" <[EMAIL PROTECTED]>
--> Sent: Thursday, December 26, 2002 11:03 AM
--> Subject: New User
--> 
--> 
--> > I have been trying to do a search of a database.  It is a very
small
--> > testing database and I wrote a search entry form with dream weaver
--> with
--> > one field.  This field should search on the title field of the
--> database
--> > and return results that contain the entry.  I am a raw newbie here
and
--> > contemplating beating my head against a wall on this.  Well my
query
--> > does not seem to work.  I get all the records returned every time
not
--> > just the ones that contain the search term.
--> >
--> > Here I was thinking this would be easy.  Boy was I wrong!  Here is
my
--> > code   Can anyone tell me what I'm doing wrong?  The path to the
--> search
--> > form is
--> >
--> > http://bluegrasspro.net/bluegrasspro/datasources/eventquery.cfm
--> >
--> >
--> >
--> > <cfquery name="rsTitle" datasource="bluegrasspro" username="LOL"
--> > password="YeaRight" debug="yes">
--> > <cfparam name="TITLE" default="null">
--> > SELECT * FROM bluegrasscalendar WHERE Title LIKE '%#TITLE#%'
--> > </cfquery>
--> >
--> > <html>
--> > <head>
--> > <title>Query Results</title>
--> > <meta http-equiv="Content-Type" content="text/html;
--> charset=iso-8859-1">
--> > </head>
--> >
--> > <body>
--> > <cfoutput query="rsTitle">
--> >             #rsTitle.Title#<br>
--> > </cfoutput>
--> >
--> > </body>
--> > </html>
--> >
--> >
--> 
-->


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Reply via email to