DevConsole::executeSqlQuery
Executes an SQL query and displays the result.
This method checks if the SQL query is received through the POST request and then attempts to execute it. If the query is not empty, it logs the query and starts buffering the output. Depending on the PHP extension loaded (mysql or mysqli), it executes the query and fetches the result. If the query execution fails, it returns an error message. If the query execution is successful, it stores the query debug data and displays it if the corresponding option is enabled. It then renders the query result based on the selected options: raw array result, table with fields, or table without fields. Finally, it displays the query result, query status, and the number of returned records.
Signature
public function executeSqlQuery()
Returns
- void