vBulletin 5.6.5 API

vB_dB_Query_Select_MYSQL extends vB_dB_Query_Select
in package

This is the MySQL-Specific version of the select query processor

Tags
version

$Revision: 99787 $

Table of Contents

BITFIELDS_KEY  = '#bitfields'
BITFIELDS_SET  = '#bitset'
BITFIELDS_UNSET  = '#bitunset'
COLUMNS_KEY  = '#columns'
CONDITION_ALL  = '#all'
CONDITIONS_KEY  = '#filters'
This class is called by the new vB_dB_Assertor database class It does the actual execution. See the vB_dB_Assertor class for more information
DEBUG_QUERY  = '#debug'
FIELDS_KEY  = '#fields'
OPERATOR_AND  = '#AND'
OPERATOR_BEGINS  = 'BEGINS'
OPERATOR_ENDS  = 'ENDS'
OPERATOR_EQ  = 'EQ'
OPERATOR_FALSE  = 'FALSE'
OPERATOR_GT  = 'GT'
OPERATOR_GTE  = 'GTE'
OPERATOR_INCLUDES  = 'INCLUDES'
OPERATOR_ISNOTNULL  = 'IS NOT NULL'
OPERATOR_ISNULL  = 'IS NULL'
OPERATOR_KEY  = 'operator'
OPERATOR_LT  = 'LT'
OPERATOR_LTE  = 'LTE'
OPERATOR_NAND  = '#NAND'
OPERATOR_NE  = 'NE'
OPERATOR_OR  = '#OR'
PARAM_LIMIT  = '#limit'
PARAM_LIMITPAGE  = '#limit_page'
PARAM_LIMITSTART  = '#limit_start'
PRIORITY_QUERY  = '#priority'
QUERY_ALTER  = 'a'
QUERY_COUNT  = 'co'
QUERY_CREATE  = 'cr'
QUERY_DELETE  = 'd'
QUERY_DROP  = 'dr'
QUERY_INSERT  = 'i'
QUERY_INSERTIGNORE  = 'ig'
QUERY_METHOD  = 'm'
QUERY_MULTIPLEINSERT  = 'mi'
QUERY_REPLACE  = 'r'
QUERY_SELECT  = 's'
QUERY_STORED  = 'st'
QUERY_TABLE  = 't'
QUERY_UPDATE  = 'u'
QUERYTYPE_KEY  = '#querytype'
SORT_ASC  = 'ASC'
SORT_DESC  = 'DESC'
TYPE_KEY  = '#type'
VALUE_ISNULL  = '#NULL'
VALUES_KEY  = '#values'
$class_name  : mixed
$configDebug  : mixed
$data_loaded  : mixed
are we ready to execute? *
$datafields  : mixed
are we ready to execute? *
$db  : mixed
$db_type  : mixed
$dbSlave  : mixed
$debugDisplayNextQuerySql  : bool
Causes the SQL for the next query that is exectuted to be displayed for debugging purposes. This only works if debug mode is turned on
$error  : mixed
The most recent error *
$errors  : mixed
All errors for this query *
$forcetext  : mixed
$method_name  : mixed
$params  : mixed
The parameters are are going to use to populate the query data
$primarykey  : mixed
What is the primary key of the table, if applicable?
$query_data  : mixed
$query_string  : mixed
What is the text of the stored query from the dictionary, if applicable?
$query_type  : mixed
$queryBuilders  : mixed
Holds the query builder object. We don't need a copy for every query so we store them here.
$querydef_object  : mixed
$querydefs  : mixed
$queryid  : mixed
The original query id *
$quotechar  : mixed
$replacements  : mixed
The replacement variables from a stored query*
$sortorder  : mixed
sortorder, for select queries only (obviously) *
$structure  : mixed
The array from a describe statement for database structure, if applicable?
$table_query  : mixed
$userinfo  : mixed
The user info **
__serialize()  : mixed
__sleep()  : mixed
__unserialize()  : mixed
__wakeup()  : mixed
debugDisplayNextQuerySql()  : mixed
Causes the SQL for the next query that is exectuted to be displayed for debugging purposes. This only works if debug mode is turned on
execSQL()  : mixed
This function is the public interface to actually execute the SQL.
getQuery()  : mixed
setQuery()  : mixed
This loads and validates the data- ensures we have all we need
setTableQuery()  : mixed
This loads and validates the data for a table. There's some extra work required
__construct()  : mixed
validates that we know what to do with this queryid
buildQuery()  : mixed
This function generates the query text against a table.
doSelect()  : object
This function does the selects and returns a result object
setQueryData()  : mixed
Sets the query Query definitions
setQueryDefs()  : mixed
Sets the querydef object

Constants

BITFIELDS_KEY

public mixed BITFIELDS_KEY = '#bitfields'

BITFIELDS_SET

public mixed BITFIELDS_SET = '#bitset'

BITFIELDS_UNSET

public mixed BITFIELDS_UNSET = '#bitunset'

COLUMNS_KEY

public mixed COLUMNS_KEY = '#columns'

CONDITION_ALL

public mixed CONDITION_ALL = '#all'

CONDITIONS_KEY

This class is called by the new vB_dB_Assertor database class It does the actual execution. See the vB_dB_Assertor class for more information

public mixed CONDITIONS_KEY = '#filters'

$queryid can be either the id of a query from the dbqueries table, or the name of a table.

if it is the name of a table , $params MUST include self::TYPE_KEY of either update, insert, select, or delete.

$params includes a list of parameters. Here's how it gets interpreted.

If the queryid was the name of a table and type was "update", one of the params must be the primary key of the table. All the other parameters will be matched against the table field names, and appropriate fields will be updated. The return value will be false if an error is generated and true otherwise

If the queryid was the name of a table and type was "delete", one of the params must be the primary key of the table. All the other parameters will be ignored The return value will be false if an error is generated and true otherwise

If the queryid was the name of a table and type was "insert", all the parameters will be matched against the table field names, and appropriate fields will be set in the insert. The return value is the primary key of the inserted record.

If the queryid was the name of a table and type was "select", all the parameters will be matched against the table field names, and appropriate fields will be part of the "where" clause of the select. The return value will be a vB_dB_Result object The return value is the primary key of the inserted record.

If the queryid is the key of a record in the dbqueries table then each params value will be matched to the query. If there are missing parameters we will return false. If the query generates an error we return false, and otherwise we return either true, or an inserted id, or a recordset.

DEBUG_QUERY

public mixed DEBUG_QUERY = '#debug'

FIELDS_KEY

public mixed FIELDS_KEY = '#fields'

OPERATOR_AND

public mixed OPERATOR_AND = '#AND'

OPERATOR_BEGINS

public mixed OPERATOR_BEGINS = 'BEGINS'

OPERATOR_ENDS

public mixed OPERATOR_ENDS = 'ENDS'

OPERATOR_EQ

public mixed OPERATOR_EQ = 'EQ'

OPERATOR_FALSE

public mixed OPERATOR_FALSE = 'FALSE'

OPERATOR_GT

public mixed OPERATOR_GT = 'GT'

OPERATOR_GTE

public mixed OPERATOR_GTE = 'GTE'

OPERATOR_INCLUDES

public mixed OPERATOR_INCLUDES = 'INCLUDES'

OPERATOR_ISNOTNULL

public mixed OPERATOR_ISNOTNULL = 'IS NOT NULL'

OPERATOR_ISNULL

public mixed OPERATOR_ISNULL = 'IS NULL'

OPERATOR_KEY

public mixed OPERATOR_KEY = 'operator'

OPERATOR_LT

public mixed OPERATOR_LT = 'LT'

OPERATOR_LTE

public mixed OPERATOR_LTE = 'LTE'

OPERATOR_NAND

public mixed OPERATOR_NAND = '#NAND'

OPERATOR_NE

public mixed OPERATOR_NE = 'NE'

OPERATOR_OR

public mixed OPERATOR_OR = '#OR'

PARAM_LIMIT

public mixed PARAM_LIMIT = '#limit'

PARAM_LIMITPAGE

public mixed PARAM_LIMITPAGE = '#limit_page'

PARAM_LIMITSTART

public mixed PARAM_LIMITSTART = '#limit_start'

PRIORITY_QUERY

public mixed PRIORITY_QUERY = '#priority'

QUERY_ALTER

public mixed QUERY_ALTER = 'a'

QUERY_COUNT

public mixed QUERY_COUNT = 'co'

QUERY_CREATE

public mixed QUERY_CREATE = 'cr'

QUERY_DELETE

public mixed QUERY_DELETE = 'd'

QUERY_DROP

public mixed QUERY_DROP = 'dr'

QUERY_INSERT

public mixed QUERY_INSERT = 'i'

QUERY_INSERTIGNORE

public mixed QUERY_INSERTIGNORE = 'ig'

QUERY_METHOD

public mixed QUERY_METHOD = 'm'

QUERY_MULTIPLEINSERT

public mixed QUERY_MULTIPLEINSERT = 'mi'

QUERY_REPLACE

public mixed QUERY_REPLACE = 'r'

QUERY_SELECT

public mixed QUERY_SELECT = 's'

QUERY_STORED

public mixed QUERY_STORED = 'st'

QUERY_TABLE

public mixed QUERY_TABLE = 't'

QUERY_UPDATE

public mixed QUERY_UPDATE = 'u'

QUERYTYPE_KEY

public mixed QUERYTYPE_KEY = '#querytype'

SORT_ASC

public mixed SORT_ASC = 'ASC'

SORT_DESC

public mixed SORT_DESC = 'DESC'

TYPE_KEY

public mixed TYPE_KEY = '#type'

VALUE_ISNULL

public mixed VALUE_ISNULL = '#NULL'

VALUES_KEY

public mixed VALUES_KEY = '#values'

Properties

$class_name

protected mixed $class_name = alse

$configDebug

protected static mixed $configDebug = alse

$data_loaded

are we ready to execute? *

protected mixed $data_loaded = alse

$datafields

are we ready to execute? *

protected mixed $datafields = alse

$db

protected mixed $db = alse

$db_type

protected mixed $db_type = 'MYSQL'

$dbSlave

protected mixed $dbSlave = alse

$debugDisplayNextQuerySql

Causes the SQL for the next query that is exectuted to be displayed for debugging purposes. This only works if debug mode is turned on

protected bool $debugDisplayNextQuerySql = alse

$error

The most recent error *

protected mixed $error = alse

$errors

All errors for this query *

protected mixed $errors = array()

$forcetext

protected mixed $forcetext = array()

$method_name

protected mixed $method_name = alse

$params

The parameters are are going to use to populate the query data

protected mixed $params = alse

$primarykey

What is the primary key of the table, if applicable?

protected mixed $primarykey = alse

$query_data

protected mixed $query_data = array()

$query_string

What is the text of the stored query from the dictionary, if applicable?

protected mixed $query_string = alse

$query_type

protected mixed $query_type = alse

$queryBuilders

Holds the query builder object. We don't need a copy for every query so we store them here.

protected static mixed $queryBuilders = array()

$querydef_object

protected mixed $querydef_object = alse

$querydefs

protected mixed $querydefs = alse

$queryid

The original query id *

protected mixed $queryid = alse

$quotechar

protected mixed $quotechar = "'"

$replacements

The replacement variables from a stored query*

protected mixed $replacements = alse

$sortorder

sortorder, for select queries only (obviously) *

protected mixed $sortorder = alse

$structure

The array from a describe statement for database structure, if applicable?

protected mixed $structure = []

$table_query

protected mixed $table_query = alse

$userinfo

The user info **

protected mixed $userinfo = alse

Methods

__serialize()

public __serialize() : mixed
Return values
mixed

__sleep()

public __sleep() : mixed
Return values
mixed

__unserialize()

public __unserialize(mixed $serialized) : mixed
Parameters
$serialized : mixed
Return values
mixed

__wakeup()

public __wakeup() : mixed
Return values
mixed

debugDisplayNextQuerySql()

Causes the SQL for the next query that is exectuted to be displayed for debugging purposes. This only works if debug mode is turned on

public debugDisplayNextQuerySql() : mixed
Tags
deprecated

never worked quite right and now does nothing.

Return values
mixed

execSQL()

This function is the public interface to actually execute the SQL.

public abstract execSQL() : mixed
Return values
mixed

getQuery()

public static getQuery(mixed $queryid, mixed $params, mixed &$db, mixed $userinfo, mixed $dbtype, mixed $dbSlave) : mixed
Parameters
$queryid : mixed
$params : mixed
$db : mixed
$userinfo : mixed
$dbtype : mixed
$dbSlave : mixed
Return values
mixed

setQuery()

This loads and validates the data- ensures we have all we need

public abstract setQuery(mixed $params, mixed $sortorder) : mixed
Parameters
$params : mixed
$sortorder : mixed
Return values
mixed

setTableQuery()

This loads and validates the data for a table. There's some extra work required

public setTableQuery(mixed $params, mixed $sortorder) : mixed
Parameters
$params : mixed
$sortorder : mixed
Return values
mixed

__construct()

validates that we know what to do with this queryid

protected __construct(mixed $queryid, mixed &$db, mixed $userinfo, mixed $dbSlave) : mixed
Parameters
$queryid : mixed
$db : mixed
$userinfo : mixed
$dbSlave : mixed
Return values
mixed

buildQuery()

This function generates the query text against a table.

protected buildQuery(mixed $values) : mixed
Parameters
$values : mixed
Return values
mixed

doSelect()

This function does the selects and returns a result object

protected doSelect() : object
Return values
object

setQueryData()

Sets the query Query definitions

protected setQueryData(mixed &$queryData) : mixed
Parameters
$queryData : mixed
Return values
mixed

setQueryDefs()

Sets the querydef object

protected setQueryDefs(mixed &$querydefs) : mixed
Parameters
$querydefs : mixed
Return values
mixed

Search results