Gruzin Posted November 17, 2006 Share Posted November 17, 2006 Hi guys,I have a problem with search an unicode text from db. I'am using PHP 5.1.2;MYSQL 5.0.18;PHPMyAdmin 2.8.0.3;My Storage Engine is - InnoDB;Collation: utf8_unicode_ci;Can enyone tell me the reason please? It does find the english word, but not (Georgian) unicode....Here is a code, hope someone will save me, thanks for reading:[code]<?php$var = $_GET['search'] ; // get the query for the search engine$trimmed = trim($var); //trim whitespace from the stored variableif(empty($trimmed)){ echo "error"; // if the form is emty notify user echo "<br>"; echo "<a href='javascript:history.back()'> error </a>"; exit(); } $count = strlen($trimmed);if($count <= 2){ echo "error"; // count chars inputed in form if less then 2 then exit echo "<br>"; echo "<a href='javascript:history.back()'> error </a>"; exit(); }require("config.php");$query = "SELECT * FROM Mater WHERE MatName LIKE '$trimmed'UNION SELECT * FROM Mater WHERE MatNameE LIKE '$trimmed'"; // run query for all tables to get the result$result = mysql_query($query) or die(mysql_error());$num = mysql_num_rows($result); //number of matching rowsecho "<span class='header'>$num found</span>"; // show the number of matching results before loopecho "<br>";echo "<a href='javascript:history.back()'> Go Back </a>";if($num > 0){ //at least one match while($row = mysql_fetch_assoc($result)){ //to loop through all of the matches $url = $row['url'];$title = $row['title'];echo '<p>';echo "<a href='".$url."'>". $title;echo '</a>';} } else{ echo '<br>'; echo "<a href='home.php'> Try Again </a>"; }?>[/code] Link to comment https://forums.phpfreaks.com/topic/27613-problem-with-unicode-text-searching/ Share on other sites More sharing options...
Gruzin Posted November 17, 2006 Author Share Posted November 17, 2006 *Bump* Link to comment https://forums.phpfreaks.com/topic/27613-problem-with-unicode-text-searching/#findComment-126298 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.