Function Database_Static_xml->_do_query_insert
Definitions
sources/database/xml.php
- Wrapper to execute an INSERT query.
- Visibility: protected
- Is abstract?: No
- Is static?: No
- Is final?: No
Parameters
Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
---|---|---|---|---|---|---|---|
$tokens | array | No | No | required parameter | N/A | N/A | Tokens |
$query | string | No | No | required parameter | N/A | N/A | Query that was executed |
$db | array | No | No | required parameter | N/A | N/A | Database connection |
$fail_ok | boolean | No | No | required parameter | N/A | N/A | Whether to not output an error on some kind of run-time failure (parse errors and clear programming errors are always fatal) |
$get_insert_id | boolean | No | No | required parameter | N/A | N/A | Whether to get the autoincrement ID created for an insert query |
&$random_key | ?integer | Yes | No | required parameter | N/A | N/A | The random key that we would use (null: not generated yet) |
$save_as_volatile | boolean | No | No | False | N/A | N/A | Whether we are saving as a 'volatile' file extension |
Returns
- The insert ID (null: not requested / error)
- Type: ?mixed
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Wrapper to execute an INSERT query.
*
* @param array $tokens Tokens
* @param string $query Query that was executed
* @param array $db Database connection
* @param boolean $fail_ok Whether to not output an error on some kind of run-time failure (parse errors and clear programming errors are always fatal)
* @param boolean $get_insert_id Whether to get the autoincrement ID created for an insert query
* @param ?integer $random_key The random key that we would use (null: not generated yet)
* @param boolean $save_as_volatile Whether we are saving as a 'volatile' file extension
* @return ?mixed The insert ID (null: not requested / error)
*/
protected function _do_query_insert(array $tokens, string $query, array $db, bool $fail_ok, bool $get_insert_id, ?int &$random_key, bool $save_as_volatile = false)
* Wrapper to execute an INSERT query.
*
* @param array $tokens Tokens
* @param string $query Query that was executed
* @param array $db Database connection
* @param boolean $fail_ok Whether to not output an error on some kind of run-time failure (parse errors and clear programming errors are always fatal)
* @param boolean $get_insert_id Whether to get the autoincrement ID created for an insert query
* @param ?integer $random_key The random key that we would use (null: not generated yet)
* @param boolean $save_as_volatile Whether we are saving as a 'volatile' file extension
* @return ?mixed The insert ID (null: not requested / error)
*/
protected function _do_query_insert(array $tokens, string $query, array $db, bool $fail_ok, bool $get_insert_id, ?int &$random_key, bool $save_as_volatile = false)