To help with what you're after, try the following as a starting point...

        search.cfm

        <cfif IsDefined("FORM.submit")>
                <cfquery name="qSearch" ....>
                        SELECT .....
                        WHERE Something LIKE '%#FORM.somethingElse#%'
                </cfquery>

                <cfif qSearch.RecordCount>
                        <cfoutput query="qSearch">
                                #qSearch.someField#
                        </cfoutput>
                <cfelse>
                        No results matey!
                </cfif>

        </cfif>

        <form acteion="search.cfm" method="post">
                <input .... />
                <input typ="submit"... />
        </form>

Rather simplified but it does what you're after. How long have you been
using ColdFusion? How are you finding it so far?

Ade

-----Original Message-----
From: sanjay sidar [mailto:[EMAIL PROTECTED]
Sent: 06 April 2004 23:03
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] search problems


thanks agin, but if i wanted to show the search results in another page how
would i do that, and what if there is nothing in my database could i have
some sort of a sign saying there are no items that match your search??

>From: "Damian Watson" <[EMAIL PROTECTED]>
>Reply-To: <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Subject: RE: [ cf-dev ] search problems
>Date: Tue, 6 Apr 2004 22:48:59 +0100
>
>Sanjay,
>
>When you do a SELECT query (when you say "search" you mean "SELECT") you
>are asking the database for records. This you have done. However, you
>haven't asked the coldfusion template to display those records. This is
>done using the cfoutput tag so you should read about that.
>
>For instance, after your query in your search.cfm if you were to put:
>
><cfoutput query="rsSearch">
>       #employee_name#
></cfquery>
>
>You would receive results supplying all the employee names.
>
>There is another way to check if you have results of your query, this is
>to use <cfdump> which I have showed you before. In this case you would
>use:
>
><cfdump var="#rsSearch#">
>
>This will output on the page any data resulting from your query called
>rsSearch.
>
>Note that cfoutput is the tag you need to learn to use when you are
>wanting to display data to a user.
>
>HTH
>d
>
>-----Original Message-----
>From: sanjay sidar [mailto:[EMAIL PROTECTED]
>Sent: 06 April 2004 19:11
>To: [EMAIL PROTECTED]
>Subject: RE: [ cf-dev ] search problems
>
>Hey guys i have this code that is supposed to search for data in my
>access
>db.  Now i have created a form in which the search is avaliable, (called
>
>form2.cfm) the way you search on this form is by a drop-down option ie
>choose a county, and you can select a country from the dropdown list.  I
>
>have created an action page called search.cfm, (which is below), now
>there
>is info in my database, but when i try to search for it nothing comes
>up,
>and another thing im confused about is that if say the user tired to
>search
>for a person's name which does exisit in my db, how do i display that?
>
>as you may have guessed im very new to this language, so any help would
>be
>much appreciated:-)
>
>sanjay, p.s the code for the action page(search.cfm is below)
>
>
><body>
><cfquery name="rsSearch" datasource="sanjay_1">
>       SELECT employee_name, company_name, country, region,
>position,department, section, random
>       FROM tblAdmins
>       WHERE 1 = 1
>       <CFIF isDefined("form.employee_name") and form.employee_name neq
>"">
>       AND employee_name = '#form.employee_name#'
>       <CFIF isDefined("form.company_name") and form.company_name neq
>"">
>       AND company_name = '#form.company_name#'
>       <CFIF isDefined("form.country") and form.country neq "">
>       AND country = '#form.country#'
>       </CFIF>
>       <CFIF isDefined("form.region ") and form.region neq "">
>       AND region = '#form.region #'
>       </CFIF>
>       <CFIF isDefined("form.section ") and form.section neq "">
>       AND section = '#form.section #'
>       </CFIF>
>       <CFIF isDefined("form.position") and form.position neq "">
>       AND position = '#form.position#'
>       </CFIF>
>       <CFIF isDefined("form.department ") and form.department neq "">
>       AND department = '#form.department #'
>       </CFIF>
></cfquery>
>
>
></body>
>
>_________________________________________________________________
>Express yourself with cool emoticons - download MSN Messenger today!
>http://www.msn.co.uk/messenger
>
>
>--
>These lists are syncronised with the CFDeveloper forum at
>http://forum.cfdeveloper.co.uk/
>Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
>CFDeveloper Sponsors and contributors:-
>*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF
>provided by activepdf.com*
>       *Forums provided by fusetalk.com* :: *ProWorkFlow provided by
>proworkflow.com*
>            *Tutorials provided by helmguru.com* :: *Lists hosted by
>gradwell.com*
>
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>
>
>--
>These lists are syncronised with the CFDeveloper forum at
>http://forum.cfdeveloper.co.uk/
>Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
>CFDeveloper Sponsors and contributors:-
>*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided
>by activepdf.com*
>       *Forums provided by fusetalk.com* :: *ProWorkFlow provided by
>proworkflow.com*
>            *Tutorials provided by helmguru.com* :: *Lists hosted by
>gradwell.com*
>
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>

_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger
http://www.msn.co.uk/messenger


--
These lists are syncronised with the CFDeveloper forum at
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided
by activepdf.com*
      *Forums provided by fusetalk.com* :: *ProWorkFlow provided by
proworkflow.com*
           *Tutorials provided by helmguru.com* :: *Lists hosted by
gradwell.com*

To unsubscribe, e-mail: [EMAIL PROTECTED]


-- 
These lists are syncronised with the CFDeveloper forum at 
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
 
CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by 
activepdf.com*
      *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
           *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*

To unsubscribe, e-mail: [EMAIL PROTECTED]

Reply via email to