我在cakephp 2.x中连接sql服务器后写下面的查询。
$this->User->find('first', array('conditions' => array('User.USER_ID' => 1)));
这将生成以下查询
SELECT TOP 1 [User].[USER_ID] AS [User__USER_ID], [User].[USER_NAME] AS [User__USER_NAME]
FROM [ec_user_details] AS [User]
WHERE [User].[USER_ID] = 1
以上查询通过以下错误
SQLSTATE[42S02]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid object name 'ec_user_details'.
如何在cakephp中通过ORM创建以下查询
SELECT TOP 1 [User].[USER_ID] AS [User__USER_ID], [User].[USER_NAME] AS [User__USER_NAME]
FROM [**DB_NAME**].[ec_user_details] AS [User]
WHERE [User].[USER_ID] = 1
请帮帮忙
1条答案
按热度按时间zaqlnxep1#
在花了很多时间之后,我找到了解决方案。
public $默认值=数组(
);