What do I do to view a problematic SQL code? |
Back in the days of CI3 and even some early versions of CI4.x, whenever an SQL code is not working as I expect it to, I would have a look at it (on the browser) using 'echo' right where the SQL code is being applied in a model or somewhere near like in a library (after being returned by a method of a model). Now it seems 'echo' does not work at all - replaced with 'return' and and even then, on the browser, we only view the 'return' value of a controller method - not a model or a library.
I don't mind if this apparent restriction is by design. My problem is that when I return an SQL code, the code is replaced with the following JSON object Code: {"db":{"DBDriver":"MySQLi","connID":{},"resultID":{},"protectIdentifiers":true,"escapeChar":"`","likeEscapeStr":" ESCAPE '%s' ","likeEscapeChar":"!","dataCache":[],"transEnabled":true,"transStrict":true,"deleteHack":true,"mysqli":{},"resultMode":0,"numberNative":false}} What do I do if I want to have a look at a problematic SQL code?
Depending on your query type, you can use one of the following:
The problem is that I was using the return value of
Code: getLastQuery() And I can view the SQL code by spewing it onto the browser at a library, and I believe even in a model. |
Welcome Guest, Not a member yet? Register Sign In |