Function DatabaseConnector->query_insert_or_replace

Definitions

sources/database.php

  • Insert a update a row (depending on whether a row with the key exists already).
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Return: bool

Parameters

Name Type Default Set Range Description
$table string required parameter N/A N/A The table name
$map array required parameter N/A N/A The INSERT/UPDATE map, minus anything in the key
$key_map array required parameter N/A N/A The WHERE map representing the key [will all be ANDed together] - must be the true key, otherwise rows will be duplicated
$fail_ok boolean False N/A N/A Whether to allow failure (outputting a message instead of exiting completely)
$save_as_volatile boolean False N/A N/A Whether we are saving as a 'volatile' file extension (used in the XML DB driver, to mark things as being non-syndicated to Git)

Return

  • Whether a smart operation was performed by the DB backend (rather than just delete-then-add)
  • Type: boolean
  • Set: N/A
  • Range: N/A