?php
$link = mssql_pconnect("192.168.0.18", "sa", "123") or die("Could not connect");
mssql_select_db("ng0001") or die("Could not select database");
$sql = "SELECT appeId,survId,location,surveyDate,surveyTime,inputUserId FROM aaa ";
$rs = mssql_query($sql);
while($obj = mssql_fetch_object($rs))
{
$arr[] = $obj;
}
$json_string = json_encode($arr);
echo $json_string?>
我的代码是这样写的,数据是英文没有问题,能帮我看看怎么改才能让select查询出的中文数据显示出来!!!而不是空值
$link = mssql_pconnect("192.168.0.18", "sa", "123") or die("Could not connect");
mssql_select_db("ng0001") or die("Could not select database");
$sql = "SELECT appeId,survId,location,surveyDate,surveyTime,inputUserId FROM aaa ";
$rs = mssql_query($sql);
while($obj = mssql_fetch_object($rs))
{
$arr[] = $obj;
}
$json_string = json_encode($arr);
echo $json_string?>
我的代码是这样写的,数据是英文没有问题,能帮我看看怎么改才能让select查询出的中文数据显示出来!!!而不是空值
header("Content-Type:text/html;charset=utf-8");
$link = mssql_pconnect("192.168.0.18", "sa", "123") or die("Could not connect");
mssql_select_db("ng0001") or die("Could not select database");
$sql = "SELECT appeId,survId,location,surveyDate,surveyTime,inputUserId FROM aaa ";
$rs = mssql_query($sql);
while($obj = mssql_fetch_object($rs))
{
$arr[] = $obj;
}
$json_string = json_encode($arr);
echo $json_string
?>
页面编码是utf-8,字段都是char类型