View Full Version : search: select similar, not like

09-19-2007, 03:34 PM

I want to make a search feature to the content of my website. I suppose, the classic way to do that is by making a form where the typed value $typed becomes a part of a select statement like this:

select from mytable where field like '%$typed%'

I would like to make a statement which allows for e.g. mis-spelling or different forms of a word. Say that the user searches for "woman" - and there happens to be content containing the word "women" instead ...

Is there perhaps also a way of ordering the results by similarity? E.g.:

select from mytable where field like '%$typed%' order by similarity

Cheers J