mysql select db error_select error:不能用DB-library(如isql)不能用DB-library(如isql
在我們php連接mssql出現select error:不能用DB-library(如isql)或odbc3.7或更早版本將ntext數據或僅使用Unicode排序規則的Unicode數據發送到客戶端
不能用DB-Library(如 ISQL)或 ODBC 3.7或更早版本將 ntext 數據
Warning: mssql_query() [function.mssql- query]: message: 不能用 DB-Library(如 ISQL)或 ODBC 3.7 或更早版本將 ntext 數據或僅使 用 Unicode 排序規則的 Unicode 數據發送到客戶端。 (severity 16) in D:PHPnowhtdocss includedb_mssql.class.php on line 55
代碼如下
復制代碼
Warning: mssql_query() [function.mssql-query]: Query failed in D:PHPnowhtdocssincludedb_mssql.class.php on line 55
MsSQL Query:SELECT * FROM PE_Config
MsSQL Error:1
MsSQL Errno:1
Message:MsSQL Query Error
在PB開發過程中,由于數據庫中使用了 ntext字段,出現以下提示錯誤,郁悶了很長時間找不到解決方案,后查閱大量資料,終于明白:
PB報錯: 不能用 DB-Library(如 ISQL)或 ODBC 3.7 或更早版本將 ntext 數據或僅使用 Unicode 排序規則的 Unicode 數據發送到客戶端。
————————————————
由于sql server中,ntext和nvarchar字段是用unicode編碼存儲內容的,因此php通過mssql擴展讀取帶ntext和nvarchar類型字段的時候會抱錯。
如果 title 字段類型為 nvarchar,content 字段類型為 ntext ,那么下面的sql語句會報錯:
代碼如下
復制代碼
select title,content from article where 1
正確的寫法是:
代碼如下
復制代碼
select convert(varchar(255),title) as title, convert(text,content) as content from article where 1
或者不使用ntext字段
不能用DB-Library(如 ISQL)或 ODBC 3.7或更早版本將 ntext 數據 Warning: mssql_query() [function.mssql- query]: message: 不能用 DB-Library(如 ISQL)或 ODBC 3.7 或更早版本將 ntext 數據或僅使 用 Unicode 排序規則的 Unicode 數據發送到客戶端。 (severity 16) in D:PHPnowhtdocss includedb_mssql.class.php on line 55 Warning: mssql_query() [function.mssql-query]: Query failed in D:PHPnowhtdocssincludedb_mssql.class.php on line 55 MsSQL Query:SELECT * FROM PE_Config MsSQL Error:1 MsSQL Errno:1 Message:MsSQL Query Error 在PB開發過程中,由于數據庫中使用了
本文原創發布php中文網,轉載請注明出處,感謝您的尊重!
總結
以上是生活随笔為你收集整理的mysql select db error_select error:不能用DB-library(如isql)不能用DB-library(如isql的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: .net数据源控件绑定mysql_理解a
- 下一篇: mysql备份需要停应用吗_对于含有in