|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
Search text in database using Coldfusion I am developing a program that will search for multiple words in the database. My code should search for one word or if there is a perfect match of multiple words. i mean if i have database rows as 1. Flash Player 2. Adobe Flash Player then the code displays both for the search "flash Player", but when i search for "Adobe Player" then too it should display the same result, which my program code does not do. Anyone help me please. |
#2
| |||
| |||
Re: Search text in database using Coldfusion Would like to see what actually your code looks like, and what data is it that yo are going to use and the result you are trying to get. Also did you try breaking the url.name into small pieces and then use LIKE to search for each piece.? You don't explain enough about what the data looks like and the result you are trying to get. But couldn't you break the url.name into pieces based on spaces and then select LIKE for each piece? |
#3
| |||
| |||
Re: Search text in database using Coldfusion Here's what i did. Code: <cfparam name="URL.NAME" default="1" type="Any"> <cfquery name="search" datasource="datasource"> SELECT * FROM search WHERE NAME LIKE ="%#URL.NAME#%"ORDER BY DATE </cfquery> |
#4
| |||
| |||
Re: Search text in database using Coldfusion Code: <cfparam name="searchStr" default=" "> <cfparam name="newArrayList" default=" "> <cfset newArrayList=ArrayNew(1)> <cfif isdefined("form.searchItems") AND form.searchItems neq ""> <cfset searchStr = #trim(form.searchItems)#> <cfset searchstr = #lcase(searchStr)#> <cfif searchstr contains " "> <cfset searchStr = Replace(searchStr," ",",")> <cfset newArrayList = ListToArray(searchstr)> <cfif newArrayList[1] neq ""> <cfset item1 = #newArrayList[1]#> </cfif> <cfif searchstr contains ","> <cfset item2 = #newArrayList[2]#> </cfif> </cfif> </cfif> |
![]() |
|
Tags: coldfusion, database, search text |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Universal Search not finding/showing certain search results, especially text messages in blackberry torch | Tiger Memon | Portable Devices | 5 | 10-10-2010 04:30 AM |
Search Access Database in Windows XP | Doroteo | Windows Software | 3 | 04-11-2009 11:19 PM |
I need a search function for my access database. | Superstar9 | Windows Software | 3 | 02-09-2009 11:33 PM |
How to update two database tables coldfusion | Rixwel | Software Development | 3 | 10-08-2009 03:13 PM |
Search Companion text search folder doesn't find all files | Hrishia | Windows XP Support | 2 | 27-11-2008 10:16 PM |