Function DatabaseConnector->query_value_if_there

Definitions

sources/database.php

  • This function is a variant of query_select_value_if_there, by the fact that it only accepts a complete (and perfect) SQL query, instead of assembling one itself from the specified parameters.
  • 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
$fail_ok boolean False N/A N/A Whether to allow failure (outputting a message instead of exiting completely)
$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: auto-detect, if not a join)

Return

  • The first value of the first row returned (null: nothing found, or null value found)
  • Type: ?mixed
  • Set: N/A
  • Range: N/A