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:
-
$table
is the SQL table in question, -
$couples
contains the column/value pairs to be modified, -
$desc
, -
$serveur
, -
$option
.
It is used as shown below:
sql_replace('table', array(
'column' => 'value',
'id_table' => $id
));