我在数据库(MS SQL Server)中有一些字段,有时也有日语数据/字符。当我使用 php 检索它们时,数据变成 ???? 比如我有一个存储“BMW and JAPANESE CHARACTER”的字段模型,当涉及到页面时它变成“BMW and ????????”
以下是我的代码;
include ('org_dataDSN.php');
//Setting up database virtual connection
echo "Connecting Database <br>";
header( 'Content-Type: text/html; charset=utf-8' );
echo "Successfully connected....";
$subQuery="select model, make from infChnge_CS2002";
$subRes=odbc_exec($connect, $subQuery);
$ix=odbc_num_rows($subRes);
echo "Success.." . $ix;
while(odbc_fetch_row($subRes))
{
$cstate = odbc_result($subRes, 1);
$sname = odbc_result($subRes, 2);
echo $cstate . "<br>";
echo $sname . "";
}
odbc_close($connect);
?>