This article mainly introduces the THINKPHP3 query MSSQL database garbled solution, the need for friends can refer to the next
thinkphp Query MSSQL Database garbled reason is thinkphp default is UTF-8, and Msmsql database is Simplified Chinese version, stored is GB2312 encoding solution: 1: In Thinkphp\lib\core Open Db.class.php, add 2 at the end of it: Find function Select () in Db.class.php, $result = $this->query ($sql), followed by a $result =iconv2utf8 ($result), OK The code is as follows: Public function Iconv2utf8 ($Result) {$Row =array (); $key 1=array_keys ($Result);//Fetch query Results $ The key value of the array of result//print_r ($key 1); $key 2=array_keys ($Result [$key 1[0]]); The key value//print_r ($key 2) of the first array ($key 1[0]) of the query result $result is taken; for ($i =0; $i
http://www.bkjia.com/phpjc/733181.html www.bkjia.com true http://www.bkjia.com/phpjc/733181.html techarticle This article mainly introduces the THINKPHP3 query MSSQL database garbled solution method, the need for friends can refer to the next thinkphp Query MSSQL Database garbled reason is thinkphp default to UTF-8, ...