Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

ps_query()

Description

Execute a prepared statement and return the results as an array.

Parameters

ColumnTypeDefaultDescription
$sql string The SQL to execute
$parameters string array An array of parameters used in the SQL in the order: type, value, type, value... and so on. Types are as follows: i - integer, d - double, s - string, b - BLOB. Example: array("s","This is the first SQL parameter and is a string","d",3.14)
$cache string "" 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 integer -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 boolean 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 integer 2 No longer used
$reconnect boolean true
$fetch_specific_columns mixed false

Return

array

This article was last updated 17th November 2024 15:05 Europe/London time based on the source file dated 18th September 2024 16:35 Europe/London time.