| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Logging SQL queries | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Logging SQL queries
Anyone know how to do this in 5.5?
I have this but it's wrong Code:
__________________
Core version: 5.5.xx |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Logging SQL queries
Are you trying to see what the actual sql query is or trying to fetch all records of a model? It's not clear.
Database::getEm() will give you the entity manager. Database::getEm()->getConnection() will give you the connection ..... chain the rest as needed or Database::getRepo(Tag::class)->createQueryBuilder('t')->select('t')->getQuery()->getSQL(); You can dump it using dd() or dump() passing the above result as an argument or you can use the XC logging to log the query from that result. If the query has params you can get them by replacing getQSL with getParameters
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
|||
X-Cart forums © 2001-2020
|