Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

sql_query()

Description

Execute a query and return the results as an array.

Database functions are wrapped in this way so supporting a database server other than MySQL is easier.

Parameters

ColumnTypeDefaultDescription
$sql mixed The SQL to execute
$cache mixed "" Disk based caching - cache the results on disk, if a cache group is specified. The group allows selected parts of the cache to be cleared by certain operations, for example clearing all cached site content whenever site text is edited.
$fetchrows mixed -1 set we don't have to loop through all the returned rows. We just fetch $fetchrows row but pad the array to the full result set size with empty values.
$dbstruct mixed true Set to false to prevent the dbstruct being checked on an error - only set by operations doing exactly that to prevent an infinite loop
$logthis mixed 2 Only relevant if $mysql_log_transactions is set. 0=don't log, 1=always log, 2=detect logging - i.e. SELECT statements will not be logged
$reconnect mixed true
$fetch_specific_columns mixed false

Return

void

This article was last updated 12th July 2020 05:05 Europe/London time based on the source file dated 1st July 2020 15:56 Europe/London time.