【发布时间】:2018-08-02 13:40:51
【问题描述】:
我试图在一个简单的选择查询中将别名表作为 UTF-8 获取,但我在别名列名中得到了乱码。
这是我的代码:
include("adodb5/adodb.inc.php");
//create an instance of the ADO connection object
$conn =&ADONewConnection ('sqlsrv');
//define connection string, specify database driver
$conn->Connect('xxx.xxx.x.xxx:1400', 'user', 'password', 'DbName');
//declare the SQL statement that will query the database
$query = "select firstName as 'שם פרטי' from users";
$rs = $conn->execute($query);
//execute the SQL statement and return records
$arr = $rs->GetArray();
print_r($arr);
这是我的结果:
Array
(
[0] => Array
(
[�� ����] => יעקב
[0] => יעקב
)
)
结果 r UTF-8,但我无法获取 UTF-8 中列的别名。
有什么想法吗?
【问题讨论】: