evilboy1151987 Posted May 15, 2010 Share Posted May 15, 2010 link to my site > http://mwlobby.0fees.net/movement.php when you write in customer name " ا " should be 3 value appear but only see "???" any help ?! <?php mysql_query("SET NAMES cp1256"); mysql_query("set characer set cp1256"); $conn = mysql_connect("****","****","***"); mysql_select_db("*****",$conn); if(isset($_GET['getCountriesByLetters']) && isset($_GET['letters'])){ $letters = $_GET['letters']; $letters = preg_replace("/[^a-z0-9 ]/si","",$letters); // << i think error is here $res = mysql_query("select customer_id,customer_name from customers where customer_name like '%".$letters."%'") or die(mysql_error()); while($inf = mysql_fetch_array($res)){ echo $inf["customer_id"]."###".$inf["customer_name"]."|"; $n = $_GET['cname']; } } ?> Link to comment https://forums.phpfreaks.com/topic/201872-autocomplate-textfield-cant-read-arabic-letter/ Share on other sites More sharing options...
CodeMaster Posted May 15, 2010 Share Posted May 15, 2010 You might want to set up the following configuration: 1. MySQL charset: UTF-8 Unicode (utf8) 2. MySQL connection collation: utf8_general_ci 3. Your database and table collations are set to: utf8_general_ci or utf8_unicode_ci Then, add this code in your php script when you connect to db: mysql_query("SET NAMES 'utf8'"); mysql_query("SET CHARACTER SET utf8"); Not tested it, but I think it should work. Link to comment https://forums.phpfreaks.com/topic/201872-autocomplate-textfield-cant-read-arabic-letter/#findComment-1058803 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.