Welcome to WebmasterWorld Guest from 188.8.131.52
Forum Moderators: open
I am trying to query a dictionary database for partial matches regardless of the position of the word(s) searched.
Let us assume that there are multiple entries for the word "bird" like:
entry 1: "a babe in arms"
Entry 2: "a babe in the woods"
Now, when I use LIKE, and the user enters "babe," no matches found, since the query does not start with "b"
What I trying to achieve:
When I search "bird", all strings containing the term bird should be displayed (in our example, 2 results).
Or when I search "woods" entry 2 should be displayed.
How can I accomplish this with MYSQL (php)?
Please note that I am a nevbie.
Thank you in advance.
"Bird" is no where in your definitions,which would make it hard to find.
If you had "bird" in a keyword column, then you could query:
SELECT * from DEFS where keyword='bird'
See the part about sorting rows in decreasing order of relevance - I use that little query structure regularly and it works pretty well for me.
Nevertheless, I will try FULLTEXT and post the results here.
Thank you again.
[edited by: trillianjedi at 11:46 am (utc) on May 3, 2006]
[edit reason] Fixing word-trapped typo ;) [/edit]