User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 423,720 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,181 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser: Programming Forums

Need Help Creating a Search Page

Join Date: Apr 2005
Location: Ontario, Canada
Posts: 24
Reputation: Walyer is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
Walyer's Avatar
Walyer Walyer is offline Offline
Light Poster

Re: Need Help Creating a Search Page

  #5  
Jun 11th, 2005
This is how I got my search page to work, for those who may need help to do the same thing

Thanks to tigeralex for some much needed information

MAIN SEARCH PAGE

\\Database information for my Artist search
<cfparam name="FORM.Artist" default="1">
<cfquery name="Search_Artist" datasource="MusicList">
SELECT *
FROM MusicList
WHERE Artist LIKE '%#FORM.Artist#%'
</cfquery>

\\Database information for my song Title search
<cfparam name="FORM.Title" default="1">
<cfquery name="Search_Title" datasource="MusicList">
SELECT *
FROM MusicList
WHERE Title LIKE '%#FORM.Title#%'
</cfquery>
....
....
....
\\forms I used search my database

\\Artist search form
<cfform method="post" action="artist.cfm">
<cfinput type="text" name="Artist" required="yes" message="Please enter the Artist name" size="40">
<input name="submit" type="submit">
</cfform>

\\Title search form
<cfform method="post" action="title.cfm">
<cfinput type="text" name="Title" required="yes" message="Please enter the Song Title" size="40">
<input name="submit" type="submit">
</cfform>


OUTPUT FOR SEARCHED DATA

Take your "music.cfm" page and do two "SAVE AS" and rename to "artist.cfm" and "title.cfm". Now add the following code to the bottom of:

"artist.cfm" then re-save

//Displays "Artist" data that was search
<cfloop query="Search_Artist">
<cfoutput># Search_Artist.Artist#</cfoutput>
</cfloop>

//Displays the "Title" information that corresponds with the "Artist" data that was search
<cfloop query="Search_Artist">
<cfoutput># Search_Artist.Title#</cfoutput>
</cfloop>

"title.cfm" then re-save

//Displays "Title" data that was search
<cfloop query="Search_Title">
<cfoutput># Search_Title.Title#</cfoutput>
</cfloop>

//Displays the "Artist" information that corresponds with the "Title" data that was search
<cfloop query="Search_Title">
<cfoutput># Search_Title.Artist#</cfoutput>
</cfloop>

I hope this helps others with the same problem I had
Attached Images
File Type: jpg search.jpg (74.7 KB, 10 views)
Reply With Quote  
All times are GMT -4. The time now is 1:05 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC