우리는 MYSQL을 실행하는 CakePHP에서 우리의 앱을 개발했으며 이것은 정상적으로 작동합니다. PHP 버전은 5.4.16, Apache 2.4.4, 최신 XAMP입니다. CakePHP 버전 : 2.3.0CakePHP의 sqlserver.php에있는 update() 함수의 문제
우리는 이미 MSSQL과 비슷한 데이터베이스를 가지고 있습니다. 이제이 MSSQL을 사용하여 앱을 실행하고 싶습니다.
MSSQL 드라이버에서 php_pdo_sqlsrv_54_ts.dll 및 php_sqlsrv_54_ts.dll을 사용하고 있습니다. 해당 SQL 서버 2005.
우리는 테이블의 값을 업데이트 할 때마다 Model.Php의 UpdateAll()을 사용하여 해당 데이터 소스의 update()를 호출합니다. 우리의 코드는 이와 같습니다.
if ($this->Configurationtable->updateAll(array('Configurationtable.configuration_optionsetting' => $limit),
array('Configurationtable.configuration_optionname =' => $optionName))) {
$this->Session->setFlash('The Result Limit has been updated');
$this->redirect(array('action' => 'edit'));
} else
{
$this->Session->setFlash('The configuration could not be saved. Please, try again.');
}
지금이 실패하고 지금
SELECT [Configurationtable].[id] AS [Configurationtable__id] FROM [configurationtable] AS [Configurationtable] WHERE [Configurationtable].[configuration_optionname] = N'searchPaginationLimit'
이다 완전히 잘못 쿼리를 생성, MySQL은 잘 작동하고 다음 업데이트 쿼리
UPDATE ipa.configurationtable AS Configurationtable SET Configurationtable.configuration_optionsetting = 12 WHERE Configurationtable.configuration_optionname = 'searchPaginationLimit'
그러나 MS SQL Server의
생성, Update() 함수를 \ lib \ Cake \ Model \ Datasource \ Database \ SqlServer.php의 Update()와 비슷하게 만들면 \ lib \ Cake \ Model \ Datasource \ Database \ Mysql.php가됩니다. 올바른 올바른 "업데이트"쿼리를 생성합니다.왜 이렇게 진행되는지 알 수 없었습니다. 내가 잘못하고있는 것이거나 케이크에 버그가 있습니까?
아무 도움이 될 것입니다.