To debug a query

How to debug a query ?

It is possible to debug a query with this piece of code to insert.

 $this->collector['example']->debug=true;

Example

The following example enables debug on the method to get the collector 'example'.

$this->collector['example']->debug=true; 
$exist = $this->collector['example']->get(array('id_example' => 1)); 
die();

This will display the SQL query executed.

SELECT id_example, lib, created_at, n_order, is_valid, ex_type FROM gen_example WHERE 1=1 AND id_example = '1'

The results of the query will be in the variable $exist.