Save data

How to check data in the database ?

Each collector can call the method set that allows you to insert or update data in the database.

 function set($primary_key_value = " , $array_fields = ") { }


  1. $primary_key_value : may be NULL (in the case of an insertion of data), OR a number corresponding to the id (in the case of a data update).
  2. $array_fields : a table that contains the data to be recorded (field / value).


The following example allows you to insert the values contained in the variable $array_fields in the table "example".

$array_fields = array('lib' => 'my example', 'field2' => 'value2'); 
$result = $this->collector['example']->set(", $array_fields);

The function's return

This method returns the id created (or updated), or FALSE if it did not work.