cakephp SQL Server 错误
我有以下数据库连接配置:
var $default = array(
'driver' => 'sqlsrv.DboSqlsrv',
'persistent' => false,
'host' => 'localhost',
'login' => 'sa',
'password' => '',
'database' => 'prospect',
'port' => NULL,
//'encoding' => 'utf8',
);
我使用 DboSqlsrv 插件。当我运行我的应用程序时,我收到一个错误:
错误:[Microsoft][SQL Server Native Client 10.0][SQL Server]对象名称“sys.synonyms”无效。 [CORE\cake\libs\model\datasources\dbo_source.php,第 684 行]
查询:选择 SUBSTRING(base_object_name,2,LEN(base_object_name)-2) 作为 对象,名称为 sys.synonyms 中的 TABLE_NAME
警告 (2):为 foreach() 提供的参数无效 [APP\plugins\sqlsrv\models\datasources\dbo\dbo_sqlsrv.php,第 253 行]
警告 (2):无法修改标头信息 - 标头已发送 by(输出开始于 C:\xampp\htdocs\prospect\cake\libs\debugger.php:683) [CORE\cake\libs\controller\components\request_handler.php,第 759 行]
但是当我刷新页面时,错误消失了。我可以登录,但是当我刷新页面时,错误再次显示。
问题是什么?
I have the following database connection configuration:
var $default = array(
'driver' => 'sqlsrv.DboSqlsrv',
'persistent' => false,
'host' => 'localhost',
'login' => 'sa',
'password' => '',
'database' => 'prospect',
'port' => NULL,
//'encoding' => 'utf8',
);
I use the DboSqlsrv plugin. When I run my application, I receive an error:
error: [Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name 'sys.synonyms'. [CORE\cake\libs\model\datasources\dbo_source.php, line 684]
Query: select SUBSTRING(base_object_name,2,LEN(base_object_name)-2) as
object,name as TABLE_NAME from sys.synonymsWarning (2): Invalid argument supplied for foreach()
[APP\plugins\sqlsrv\models\datasources\dbo\dbo_sqlsrv.php, line 253]Warning (2): Cannot modify header information - headers already sent
by (output started at
C:\xampp\htdocs\prospect\cake\libs\debugger.php:683)
[CORE\cake\libs\controller\components\request_handler.php, line 759]
But when I refresh the page, the error is gone. I can login, but when I refresh the page the error is shown again.
What is the problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
像这样使用
我猜您为驱动程序提供了错误的值....请尝试这种方式....让我知道您的配置设置以获得更好的答案。
希望这会对您有所帮助。
Use like this
You are giving wrong value for driver i guess....try this way instead....let me know your configuration settings for a better answer.
Hope this wil lelp you.