简体   繁体   中英

ZF2: run MySQL command “SET SQL_BIG_SELECTS=1” before executing SQL-statements

How do I execute a query (eg SET SQL_BIG_SELECTS=1 ) before running statements in ZF2 (Zend Framework 2)?

I tried already setting it in the "driver_options" but with no success.

Usually many statements will be build with \\Zend\\Paginator\\Adapter\\DbTableGateway or \\Zend\\Paginator\\Adapter\\DbSelect.

I think there should be a hook via the "Shared Manager", but dont know how to implement it.

Thanks for your help!

Pull your adapter instance from the service manager and use the query method to execute it. Alternatively, if the underlying adapter natively supports it you can pass options at the time you configure the adapter. There's an example of doing that in the manual comments section, here for a different option (forcing UTF8)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM