当我想用Linux连接mssql server和linux时,我收到了这个错误。
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 10007 Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. [10007] (severity 5)
这是我的连接代码:
使用error_reporting(E_ERROR);
$dsn='mssql:host=***;dbname=***;';
$username='***';
$passwd='***';
try{
$baglanti=new PDO($dsn,$username,$passwd);
$baglanti->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
}catch(PDOException $e){
echo 'Error:'.$e->getMessage();
}
我如何解决这个问题?
感谢。