Function DatabaseConnector->query
Definitions
sources/database.php
- This function is a raw query executor.This should rarely ever be used; other functions like query_select are available. Additionally, for complex queries, it is still better to use query_parameterised as it handles escaping.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Return: N/A
Parameters
Name | Type | Default | Set | Range | Description |
---|---|---|---|---|---|
$query | string | required parameter | N/A | N/A | The complete SQL query |
$max | ?integer | Null | N/A | N/A | The maximum number of rows to affect (null: no limit) |
$start | integer | 0 | N/A | N/A | The start row to affect |
$fail_ok | boolean | False | N/A | N/A | Whether to output an error on failure |
$skip_safety_check | boolean | False | N/A | N/A | Whether to skip the query safety check |
$lang_fields | ?array | Null | N/A | N/A | Extra language fields to join in for cache pre-filling / Tempcode, perhaps via the find_lang_fields function. You only need to send this if you are doing a JOIN and carefully craft your query so table field names won't conflict (null: none) |
$field_prefix | string | Blank (empty string) | N/A | N/A | All the core fields have a prefix of this on them, so when we fiddle with language lookup we need to use this (only consider this if you're setting $lang_fields) |
Return
- The results (null: no result set) (empty array: empty result set)
- Type: ?mixed
- Set: N/A
- Range: N/A