Hello,
First of all sorry for bad english :-)
I have some data in mysql database. Have also search box which works fine except for "special croatian signs". We have š,ž,č,ć,đ.
So, š and ž works also fine but ć, č đ doesn't work. I search a little bit and change unicode to UTF8, and also add three line in conn file:
mysql_query("SET NAMES utf8");
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET COLLATION_CONNECTION='utf8_unicode_ci'");
But still have nothing :-(
When I enter đ instead đ, search work fine. Also when i enter sql query in mysql, works fine. But thrue web search failed.
This is search code:
<?php
if (!empty($_REQUEST['term'])) {
$term = mysql_real_escape_string($_REQUEST['term']);
$sql = "SELECT * FROM table WHERE name LIKE '%".$term."%' OR proiz LIKE '%".$term."%'";
$r_query = mysql_query($sql);
while ($row = mysql_fetch_array($r_query)){
echo '<a href="2.php?id='.$row['id'].'">'.$row['name'].'</a>';
echo '<br /> Tel: '.$row['tel'];
echo '<br /> Proiz: '.$row['proiz'];
echo '<br /><br /><br /><br /> ';
}
}
?>
Is it possible to check and replace search term if user enter đ to replace it to đ and do the search?
Again appologize for bad english and lack of knowledge in php
Thanks in advance