Searching Within a Column and UTF-8
Posted: Thu Jan 25, 2007 6:54 pm
I'm adding a Korean-english / english-Korean dictionary to a database but am having one final problem.
I have the English words all in a column, and Korean meanings in another column.
If you type in an English word, the Korean column may hold multiple words that are all the same meaning, all separated by commas. Currently, they are all listed in the same column.
I can do a search on the database WHERE english='word', and the correct row is returned - I can print out any column and everything works just fine.
However, I cannot do a search on the database WHERE korean='korean-word' and get the results to return properly. I'm not sure why either.
When the PHP processes the query, is it no longer in the utf-8 encoding, thus resulting in a wrong answer?
I thought perhaps it was because there were multiple meanings in the same row at first. However, if I search for the full value stored in that Korean column (copy and pasted exactly), and run the search WHERE korean='value', it still does not find the row.
So I have two questions - anyone have any idea why results are never found when searching using Korean text (in utf-8 format)?
And can you search for a value, and if it is found ANYWHERE in a given column (even if it is not the only word in that column), and get a value (maybe return multiple rows?).
I have the English words all in a column, and Korean meanings in another column.
If you type in an English word, the Korean column may hold multiple words that are all the same meaning, all separated by commas. Currently, they are all listed in the same column.
I can do a search on the database WHERE english='word', and the correct row is returned - I can print out any column and everything works just fine.
However, I cannot do a search on the database WHERE korean='korean-word' and get the results to return properly. I'm not sure why either.
When the PHP processes the query, is it no longer in the utf-8 encoding, thus resulting in a wrong answer?
I thought perhaps it was because there were multiple meanings in the same row at first. However, if I search for the full value stored in that Korean column (copy and pasted exactly), and run the search WHERE korean='value', it still does not find the row.
So I have two questions - anyone have any idea why results are never found when searching using Korean text (in utf-8 format)?
And can you search for a value, and if it is found ANYWHERE in a given column (even if it is not the only word in that column), and get a value (maybe return multiple rows?).