|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
||||
|
||||
|
Search Strings...
Hi, I have a search function on my site, and what happens at them moment is the user fills in a text box with their search string, and clicks submit. The search page takes their string, and splits it up where it sees " ". All fairly simple, what I'd like is to allow the user to enter text in speechmarks, so the script would search for a couple of words together, as well as being able to search for every individual word...
Everyone confused yet?! e.g If the user enters Dev Shed Forums , then the search would look for every occurance of the strings "Dev", "Shed" and "Forums" What I want is for the user to be able to enter "Dev Shed" Forums, and the search will look for "Dev Shed" and "Forums"... Any ideas anyone?? Cheers boys.
__________________
Support requests via PM will be ignored! |
|
#2
|
|||
|
|||
|
instead of splitting on spaces do a replace on spaces with _ or % depending on how fuzzy you want your search to be (add % around the ends?). If you want "dev shed" to match but they entered "dev shed forums", you need to start breaking it up into multiple parts such as loops through the string like
Code:
WHERE blah LIKE '%dev_shed%' OR blah LIKE '%shed_forums%' i think you get the point. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Search Strings... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|