Forum Moderators: coopster

Message Too Old, No Replies

Simple Select

         

bobnew32

10:01 pm on Mar 14, 2004 (gmt 0)

10+ Year Member



Yeah i'm not the best as mysql, but I know my way around. Newayz, I have a script where the user inputs the $show_name through a form, and the database goes to check if anything like that name is present.

But " like %$show%" only pulls up if the show entered is part of a string, I need to pull up somthing where if "Charmed" is entered, then "Charmmed", "Charmer", "Charmedd" pops out as the result. Kind of like a mini search engine for a single simple field.

Help?

mykel79

10:21 pm on Mar 14, 2004 (gmt 0)

10+ Year Member



You could try using the SOUNDEX function.
Something like
select * from table where SOUNDEX(show) like SOUNDEX('$show');

In theory two strings that sound the same should return the same value for SOUNDEX.
The query above works for simple misspellings (lik an "s" instead of "ss") because I just tried it. I've never used it in a script myself though, so I don't know how well it works.

bobnew32

11:16 pm on Mar 14, 2004 (gmt 0)

10+ Year Member



Yeah I knew about sounddex but I really didn't know if there was somthing built into a mysql command that would help me out... Any other at all suggestions please post and to the abover person, thx!

coopster

1:57 pm on Mar 15, 2004 (gmt 0)