Function Database_super_mysql->query_insert_or_replace
Definitions
sources/database/shared/mysql.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
- Returns: string
Parameters
Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
---|---|---|---|---|---|---|---|
$table | string | No | No | required parameter | N/A | N/A | The table name |
$map | array | No | No | required parameter | N/A | N/A | The INSERT/UPDATE map, minus anything in the key |
$key_map | array | No | No | required parameter | N/A | N/A | The WHERE map representing the key [will all be ANDed together] |
$fail_ok | boolean | No | No | False | N/A | N/A | Whether to allow failure (outputting a message instead of exiting completely) |
$save_as_volatile | boolean | No | No | 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) |
Returns
- SQL query (null: not supported)
- Type: ?string
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Insert a update a row (depending on whether a row with the key exists already).
*
* @param string $table The table name
* @param array $map The INSERT/UPDATE map, minus anything in the key
* @param array $key_map The WHERE map representing the key [will all be ANDed together]
* @param boolean $fail_ok Whether to allow failure (outputting a message instead of exiting completely)
* @param boolean $save_as_volatile 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 ?string SQL query (null: not supported)
*/
public function query_insert_or_replace(string $table, array $map, array $key_map, bool $fail_ok = false, bool $save_as_volatile = false) : ?string
* Insert a update a row (depending on whether a row with the key exists already).
*
* @param string $table The table name
* @param array $map The INSERT/UPDATE map, minus anything in the key
* @param array $key_map The WHERE map representing the key [will all be ANDed together]
* @param boolean $fail_ok Whether to allow failure (outputting a message instead of exiting completely)
* @param boolean $save_as_volatile 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 ?string SQL query (null: not supported)
*/
public function query_insert_or_replace(string $table, array $map, array $key_map, bool $fail_ok = false, bool $save_as_volatile = false) : ?string