5

Debugging DB queries with the ORM changes introduced in 3.2 became more difficult. Running $dataList->sql() gives you the prepared statement (in form of SELECT * FROM Table WHERE Title = ?) which is a good start. ?showqueries URL variable does the same.

How to get the values, or parameters, of the statement is what I'm interested in. I'm aware of https://github.com/lekoala/silverstripe-debugbar but I'd like to know if there's a way to get them without any extensions in XDebug console (or just by var_dump:ing something).

I looked quickly through the code of silverstripe-debugbar but didn't find an easily usable solution. If it is there somewhere please point me to it :)

jlilja
  • 400
  • 1
  • 5
  • 17
  • 1
    AS informed by the pull requester... https://github.com/silverstripe/silverstripe-framework/pull/4582 – Barry Aug 05 '16 at 11:05
  • I was *so* close to voting to close this [as a duplicate](http://stackoverflow.com/questions/2303972/how-can-i-view-the-contents-of-a-prepared-statement) until I saw that pull request! – scrowler Sep 26 '16 at 11:21

0 Answers0