Home » questions » PHP Search help and suggestions?
PHP Search help and suggestions?
I am building a search in PHP. A state is selected (hopefully) from a drop down list and a city is entered. I have it working with exact matches and if the city is short letters (on either or both ends). I am wanting it to find matches if there are extra letters. For example if someone types in Hollywood, CA in the city box or Hollywoodd. Here's my WHERE clause...
"name LIKE '%$searched_city%' AND '$id' = parent"
The id is the ID of the state selected and parent is in the table with the city that tells what state the city belongs to. The problem is in the LIKE statement.
Also, any suggestions on other errors to check for.. besides the obvious. And does anyone know a way to catch errors in spelling besides having a table of alternate spellings. Aaaaand... any suggestions on how to check for FT (Fort), MT (Mount), ST (Saint), etc stuff... I am grateful for any ideas, help, and suggestions. Thanks.

Answers
tedjn
On 2006-08-01 14:59:05