PHP5 and MySQL5 With Thai Encoding
by toy
Use this code to enable thai support
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | $dbhost = 'localhost'; $dbuser = 'user'; $dbpass = 'pass'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'webboard'; mysql_select_db($dbname); mysql_query("SET character_set_results=tis620"); mysql_query("SET character_set_client='tis620'"); mysql_query("SET character_set_connection='tis620'"); mysql_query("collation_connection = tis620_thai_ci"); mysql_query("collation_database = tis620_thai_ci"); mysql_query("collation_server = tis620_thai_ci"); |
Twitter
Facebook