我正在PHP中查询以从MSSQL EXPRESS(2008 R2)数据库连接和提取数据。但是当我从数据库中抽取基于ntext的数据时,我收到一个错误。
错误是
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. (severity 16) in
和我的脚本是
$myServer = ".\SQLEXPRESS";
$myUser = "sa";
$myPass = "blablabla";
$myDB = "test";
//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle)
or die("Couldn't open database $myDB");
//declare the SQL statement that will query the database
$query = "SELECT * FROM dbo.table WHERE query='2'";
//$query .= "FROM dbo.table ";
//$query .= "WHERE query='2'";
//execute the SQL query and return records
$result = mssql_query($query);
$numRows = mssql_num_rows($result);
echo "
" . $numRows . " Row" . ($numRows == 1 ? "" : "s") . " Returned
";//display the results
while($row = mssql_fetch_array($result))
{
echo "
" . $row["query"]. "";}
//close the connection
mssql_close($dbhandle);
任何帮助,这是赞赏….
谢谢 ….