Run a specific query

How to proceed with the execution of a specific query ?

Each collector can call the method Query which allows you to run a query very specific.

 function Query($sql_query) { }

Settings

  1. $sql_query : the SQL query (string).

Example

The following example allows you to retrieve the values of the collector "example" via the query present in the variable $sql_query.

$sql_query = "SELECT * FROM gen_example WHERE id_example = '1'"; 
$rs = $this->collector['example']->Query($sql_query); 
$result = $this->collector['example']->GetRows($rs); 

The function's return

This method returns an array containing the values.

Array 
( 
 [0] = Array 
 ( 
 [id_example] = One 
 [lib] = Item 1 
 [created_at] = 2019-05-03 14:33:10 
 [n_order] = One 
 [is_valid] = One 
 [ex_type] = EX1 
 ) 


)