Coding with SPIP 3.0
SPIP3.0 Technical Documentation

> > > > sql_replace

sql_replace

The sql_replace() function inserts or updates a record in an SQL table. The primary key(s) must exist amongst the inserted data. The function automatically secures the data.

It is recommended to use the specific sql_insertq() and sql_updateq() instead of this function to be more precise, at least where such is possible.

Its 5 parameters are:

  1. $table is the SQL table in question,
  2. $couples contains the column/value pairs to be modified,
  3. $desc,
  4. $serveur,
  5. $option.

It is used as shown below:

  1. sql_replace('table', array(
  2. 'column' => 'value',
  3. 'id_table' => $id
  4. ));

Download

  • Author :
  • Published :
  • Updated : 01/06/10
  • Translations : English, français