When trying to access MS SQL DB using PDO, I get the following error:
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) [SELECT * FROM Lessons]
How do I fix it?
Any help would be greatly appreciated.
PDO Problem
Moderator: General Moderators
Error seems to indicate the library PHP has used for the PDO extension is outdated. Are you using PDO_ODBC or PDO_DBLIB?
Quotes from the PHP manual section on PDO_DBLIB:
Some additional information would help, I'm sure:
Is PHP on a Windows or UNIX server? What server version? What PHP version?
Is this on your own server or a hosting company? Have you contacted their tech support?
Have you been / are you successful in using the same SELECT statement by other methods other than PDO?
Please note I have never worked with this specific PDO driver nor have I ever worked with MS SQL, just trying to help.
Quotes from the PHP manual section on PDO_DBLIB:
...and more importantly...This extension is EXPERIMENTAL. The behaviour of this extension -- including the names of its functions and anything else documented about this extension -- may change without notice in a future release of PHP. Use this extension at your own risk.
On Windows, you should use the PDO_ODBC driver to connect to Microsoft SQL Server and Sybase databases, as the native Windows DB-LIB is ancient, thread un-safe and no longer supported by Microsoft.
Some additional information would help, I'm sure:
Is PHP on a Windows or UNIX server? What server version? What PHP version?
Is this on your own server or a hosting company? Have you contacted their tech support?
Have you been / are you successful in using the same SELECT statement by other methods other than PDO?
Please note I have never worked with this specific PDO driver nor have I ever worked with MS SQL, just trying to help.