Editor SSP: Viewing the SQL used to query the database

Editor SSP: Viewing the SQL used to query the database

sirchunksirchunk Posts: 9Questions: 2Answers: 0
edited January 2019 in Free community support

Hi,

Before trialing Editor, I was using just DataTables and the SSP class
In there I could save the SQL query to a var before passing it to sql_exec() then add it to the output array so I can display it in the console using:

initComplete: function(settings, json) {
    console.log(settings);
    console.log(json);
}

Can something similar be done with Editor to view the full SQL query used when querying the database?

Answers

  • sirchunksirchunk Posts: 9Questions: 2Answers: 0

    Answered my own question.

    using debug( true ) does what I want and outputs it to the console, albeit it doesn't work.
    I have to manually change private $_debug = false; in Editor.php to true for it to work, which says something else isn't right somewhere as the SQL query returned works when I manually add it to psql

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    What is the error message you are getting? Can you show me the JSON return from the server when you have debugging enabled?

    Thanks,
    Allan

  • sirchunksirchunk Posts: 9Questions: 2Answers: 0

    Hi Allan, a bit embarrassing really and a schoolboy error.
    I created a new table I was querying against and forgot to add the permission needed for the user setup in the PDO object to access the table.

This discussion has been closed.