![]() |
|
#1
|
|||
|
|||
Need help with my Search ScriptI need some help with my search script. I use this script to search for information based on location, and when I use Kansas, I also get Arkansas.
Can you show me what the problem is? Here is the PHP script for the search feature. PHP Code:
|
|
#2
|
||||
|
||||
Re: Need help with my Search ScriptYes, the 'like' operator is giving you exactly what you want [based on the use of 'like']...
Think about it...Arkansas and Kansas BOTH contain 'kansas', so you'll have to control the pattern-match, or do something else. This is the same as if a user entered 'or', then Oregon, Georgia, Florida, and others..., will match the result. EDIT: I may not offer the best solution, but a few ideas come to mind... 1. show the user ALL results of their match, and let them choose. 2. Offer a combo-box choice of states to search (then merely use the selection) 3. Provide a radio-button option as to whether the search is 'pattern' or 'exact' and then modify the select string to contain the like [ if a pattern ] or = [ if exact ]. 4. Add another column that is the 2-letter state abbreviation, and offer to search that. __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
Recent GIDBlog
First week of IA training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Web stats | fcolor | Web Design Forum | 10 | 12-Jul-2007 08:48 |
| Need Free Website Templates | sam_dezine | Web Design Forum | 8 | 06-Sep-2006 03:25 |
| Who Is A Web Designer ? | alicehopkins | Web Design Forum | 1 | 13-Jun-2006 02:56 |
| HTML Code | amgujral | Web Design Forum | 0 | 07-Apr-2006 09:46 |
| Search Engine Positioning 101 and 201 "How To" Tips... | 000 | Search Engine Optimization Forum | 0 | 29-May-2003 10:34 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The