Function DatabaseConnector->_query

Definitions

sources/database.php

  • This function is a very basic query executor. It shouldn't usually be used by you, as there are specialised abstracted versions available.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$query string No No required parameter N/A N/A The complete SQL query
$max ?integer No No Null N/A N/A The maximum number of rows to affect (null: no limit)
$start integer No No 0 N/A N/A The start row to affect
$fail_ok boolean No No False N/A N/A Whether to output an error on failure
$get_insert_id boolean No No False N/A N/A Whether to get an insert ID
$lang_fields ?array No No 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 No No 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)
$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

  • The results (null: no result set) (empty array: empty result set)
  • Type: ?mixed
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * This function is a very basic query executor. It shouldn't usually be used by you, as there are specialised abstracted versions available.
 *
 * @param  string $query The complete SQL query
 * @param  ?integer $max The maximum number of rows to affect (null: no limit)
 * @param  integer $start The start row to affect
 * @param  boolean $fail_ok Whether to output an error on failure
 * @param  boolean $get_insert_id Whether to get an insert ID
 * @param  ?array $lang_fields 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)
 * @param  string $field_prefix 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)
 * @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 ?mixed The results (null: no result set) (empty array: empty result set)
 */

public function _query(string $query, ?int $max = null, int $start = 0, bool $fail_ok = false, bool $get_insert_id = false, ?array $lang_fields = null, string $field_prefix = '', bool $save_as_volatile = false)