kaisellgren
07-10-2006, 11:13 AM
Hi. I think this is very hard or impossible. But let's begin...
I have a search function in my website. <input type="text" name="search" />
Well anyways, there is such text in my website like: "čurti" "čuožžut" and so on...
The problem is that when user searches with word "curti" not "čurti" it should find the page.
Some code to help to understand:
$search = trim(mysql_escape_string($_POST["search"]));
$result = mysql_query("SELECT * FROM wt_pagesearchwords WHERE word='$search'");
You can see the part: "word='$search'"... so if user searches with word čurti, it will be like:
$search = čurti;
$result = mysql_query("SELECT * FROM wt_pagesearchwords WHERE word='čurti'");
But that's not enough. I need it to convert the čurti to curti...
Detailed question: I have a empty single page that has only 1 search word, it is čurti... but if user searches with curti, it should also find that čurti although it's spelled in otherway...
This question is much like the Google search's "Did you mean blah blah?" when search returned nothing.
Anyway understood? Sorry my bad English, I'm scandinavian...
Thanks anyways,
Kai
EDIT: here's what I need:
$search = trim(mysql_escape_string($_POST["search"]));
$result = mysql_query("SELECT * FROM wt_pagesearchwords WHERE word='$search'");
The Underlined&Bold text above is what I need to change. They BOTH should be converted from UTF-8 to ASCII like č to c, ä to a, õ to o, etc...
EDIT2: lol. the bold & underline didn't work in the codebox :P
I have a search function in my website. <input type="text" name="search" />
Well anyways, there is such text in my website like: "čurti" "čuožžut" and so on...
The problem is that when user searches with word "curti" not "čurti" it should find the page.
Some code to help to understand:
$search = trim(mysql_escape_string($_POST["search"]));
$result = mysql_query("SELECT * FROM wt_pagesearchwords WHERE word='$search'");
You can see the part: "word='$search'"... so if user searches with word čurti, it will be like:
$search = čurti;
$result = mysql_query("SELECT * FROM wt_pagesearchwords WHERE word='čurti'");
But that's not enough. I need it to convert the čurti to curti...
Detailed question: I have a empty single page that has only 1 search word, it is čurti... but if user searches with curti, it should also find that čurti although it's spelled in otherway...
This question is much like the Google search's "Did you mean blah blah?" when search returned nothing.
Anyway understood? Sorry my bad English, I'm scandinavian...
Thanks anyways,
Kai
EDIT: here's what I need:
$search = trim(mysql_escape_string($_POST["search"]));
$result = mysql_query("SELECT * FROM wt_pagesearchwords WHERE word='$search'");
The Underlined&Bold text above is what I need to change. They BOTH should be converted from UTF-8 to ASCII like č to c, ä to a, õ to o, etc...
EDIT2: lol. the bold & underline didn't work in the codebox :P