sql_updateq

The sql_updateq() function is used to update content in an SQL table. The content passed to the function is automatically filtered.

Its 6 arguments are the same as for sql_update():

  1. $table is the SQL table in question,
  2. $exp contains the modifications to be made,
  3. $where,
  4. $desc,
  5. $serveur,
  6. $option.

It is used as shown below:

sql_updateq('table', array('column' => $value), 'id_table=' . intval($id_table));

Example

The modifier_contenu() function in ecrire/inc/modifier.php is called when an editorial object is modified, and takes care of calling the pre_edition and post_edition pipelines, using the sql_updateq() function to update the collected data:

sql_updateq($spip_table_objet, $champs, "$id_table_objet=$id", $serveur);

Author Mark Baber Published : Updated : 12/05/17

Translations : English, français