Zend Framework 2,PDO dblib驱动程序,如何更改SQL Platform Decorator [英] Zend Framework 2, PDO dblib driver, how to change SQL Platform Decorator

查看:86
本文介绍了Zend Framework 2,PDO dblib驱动程序,如何更改SQL Platform Decorator的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎带有PDO:dblib驱动程序的ZF2默认使用SQL92 SQL装饰器.如何使用DI系统告诉它使用SqlServer装饰器?只是无法绕开它.

It seems that ZF2 with the PDO:dblib driver defaults to using the SQL92 SQL decorator. How do I use the DI system to tell it to use the SqlServer decorator instead? Just can't get my head around it.

问题在于分页器尝试使用LIMIT/OFFSET语法,而该语法在SQL Server中不起作用.

The issue is that the paginator attempts to use LIMIT/OFFSET syntax which doesn't work in SQL Server.

另一种措辞方式是如何自定义表对象上从fetchAll()返回的Paginator以使用SqlServer平台?

Another way of phrasing it is how do I customise the Paginator returned from fetchAll() on a table object to use the SqlServer platform?

克里斯

推荐答案

好吧,在对Zend Framework进行大量研究之后,我发现有一种更简便的方法.只需像这样设置数据库配置:

OK, well I found there's a much easier way to do it, after much digging through the Zend Framework. Simply set up your database config like this:

'db' => array(
    'driver' => 'Pdo',
    'dsn' => 'dblib:host=xxx;dbname=xxx',
    'username' => 'xxxxxxxx',
    'password' => 'xxxxxxxx',
    'charset' => 'UTF-8',
    'platform' => 'SqlServer'
)

现在我遇到了其他错误,请继续讲故事!

Now I'm getting different errors, will continue the story!

这篇关于Zend Framework 2,PDO dblib驱动程序,如何更改SQL Platform Decorator的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆