这让我很难过.我正在尝试为我的 Sqlserver 连接设置编码,但我尝试的所有方法都失败了.我只得到
This has me stumped. I am trying to set encoding for my Sqlserver connection and all that I have tried has failed. I only get
错误:使用Sqlserver"的数据库连接丢失或无法连接连接.
数据库服务器返回此错误:SQLSTATE[IMSSP]: 指定的编码无效SQLSRV_ATTR_ENCODING.
Error: A Database connection using "Sqlserver" was missing or unable to connect.
The database server returned this error: SQLSTATE[IMSSP]: An invalid encoding was specified for SQLSRV_ATTR_ENCODING.
我试图通过编码解决的原始错误是:
The original error I was trying to solve through encoding is:
错误:SQLSTATE[IMSSP]:翻译查询字符串时发生错误到 UTF-16:目标中不存在 Unicode 字符的映射多字节代码页.
Error: SQLSTATE[IMSSP]: An error occurred translating the query string to UTF-16: No mapping for the Unicode character exists in the target multi-byte code page.
SQL 版本为 2008 R2
Cakephp 版本:2.4.2
PHP 版本:5.3.27
The SQL version is 2008 R2
Cakephp Version: 2.4.2
PHP Version: 5.3.27
经过大量的试验和错误,这有效:
After a lot of trial and error this works:
public $default = array(
'datasource' => 'Database/Sqlserver',
'persistent' => false,
'host' => 'localhost',
'login' => 'sa',
'password' => 'password',
'database' => 'SchedulingDatabase',
'encoding' => PDO::SQLSRV_ENCODING_UTF8
);
这篇关于Cakephp Sqlserver 编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
不能使用 'Object 作为类名,因为它是保留的Cannot use #39;Object as class name as it is reserved Cake 2.2.x(不能使用 Object 作为类名,因为它是保留的 Cake 2.2.x)
OAuth 重定向后会话丢失Session is lost after an OAuth redirect(OAuth 重定向后会话丢失)
Cakephp 3.x 中的分页排序Pagination Sort in Cakephp 3.x(Cakephp 3.x 中的分页排序)
CakePHP 多个应用程序的共享核心CakePHP Shared core for multiple apps(CakePHP 多个应用程序的共享核心)
在 CakePHP 3 上登录 [ Auth->identify() ] 始终为 falLogin [ Auth-gt;identify() ] always false on CakePHP 3(在 CakePHP 3 上登录 [ Auth-identify() ] 始终为 false)
致命错误:允许的内存大小为 134217728 字节已用尽Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 87 bytes)(致命错误:允许的内存大小为 134217728 字节已用尽