class vB_dB_Query_Create_MYSQL extends vB_dB_Query_Create

This is the MySQL-Specific version of the Create Table-type queries processor

Traits

Constants

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

$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.

FIELDS_KEY

VALUES_KEY

TYPE_KEY

COLUMNS_KEY

QUERYTYPE_KEY

OPERATOR_KEY

PRIORITY_QUERY

DEBUG_QUERY

CONDITION_ALL

OPERATOR_LT

OPERATOR_LTE

OPERATOR_GT

OPERATOR_GTE

OPERATOR_EQ

OPERATOR_NE

OPERATOR_BEGINS

OPERATOR_ENDS

OPERATOR_INCLUDES

OPERATOR_ISNULL

OPERATOR_ISNOTNULL

OPERATOR_AND

OPERATOR_NAND

OPERATOR_OR

OPERATOR_FALSE

VALUE_ISNULL

QUERY_SELECT

QUERY_COUNT

QUERY_STORED

QUERY_UPDATE

QUERY_INSERT

QUERY_INSERTIGNORE

QUERY_REPLACE

QUERY_MULTIPLEINSERT

QUERY_DELETE

QUERY_METHOD

QUERY_DROP

QUERY_CREATE

QUERY_ALTER

PARAM_LIMIT

PARAM_LIMITSTART

PARAM_LIMITPAGE

BITFIELDS_KEY

SORT_ASC

SORT_DESC

QUERY_TABLE

Properties

protected $db The database connection * from vB_dB_Query
protected $dbSlave And the slave connection * from vB_dB_Query
protected $userinfo The user info ** from vB_dB_Query
protected $quotechar The character used for quoting in an sql string- usually '. from vB_dB_Query
protected $table_query We need to know whether we are using a table query when we compose the sql replacements * from vB_dB_Query
protected $query_type from vB_dB_Query
protected $data_loaded are we ready to execute? * from vB_dB_Query
protected $datafields are we ready to execute? * from vB_dB_Query
protected $primarykey What is the primary key of the table, if applicable? from vB_dB_Query
protected $query_string What is the text of the stored query from the dictionary, if applicable? from vB_dB_Query
protected $params The parameters are are going to use to populate the query data from vB_dB_Query
protected $structure The array from a describe statement for database structure, if applicable? from vB_dB_Query
protected $replacements The replacement variables from a stored query* from vB_dB_Query
protected $queryid The original query id * from vB_dB_Query
protected $error The most recent error * from vB_dB_Query
protected $errors All errors for this query * from vB_dB_Query
protected $sortorder sortorder, for select queries only (obviously) * from vB_dB_Query
protected $table_data This is the definition for tables we will process through. It saves a database query to put them here. from vB_dB_Query
protected $query_data from vB_dB_Query
protected $method_name from vB_dB_Query
protected $querydef_object from vB_dB_Query
protected $class_name from vB_dB_Query
protected $forcetext from vB_dB_Query
protected $querydefs from vB_dB_Query
protected bool $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 from vB_dB_Query
static protected $configDebug from vB_dB_Query
static protected $queryBuilders Holds the query builder object. We don't need a copy for every query so we store them here. from vB_dB_Query
protected $db_type

Methods

__sleep()

No description

__wakeup()

No description

static 
getQuery($queryid, $params, $db, $userinfo, $dbtype, $dbSlave)

No description

__construct($queryid, $db, $userinfo)

standard constructor.

setQuery($params, $sortorder)

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

setTableQuery($params, $sortorder)

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

mixed
execSQL()

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

mixed
buildQuery($values)

This function generates the query text against a table.

debugDisplayNextQuerySql() deprecated

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

setQueryData(mixed $queryData)

Sets the query Query definitions

setTableData(mixed $tableData, string $queryid)

Sets the query Table definitions

setQueryDefs(object $querydefs)

Sets the querydef object

setStructure(object $structure)

Sets the table structure.

Details

in vB_Trait_NoSerialize at line 15
__sleep()

in vB_Trait_NoSerialize at line 20
__wakeup()

in vB_dB_Query at line 219
static getQuery($queryid, $params, $db, $userinfo, $dbtype, $dbSlave)

Parameters

$queryid
$params
$db
$userinfo
$dbtype
$dbSlave

in vB_dB_Query_Create at line 64
__construct($queryid, $db, $userinfo)

standard constructor.

@param string id of the query

Parameters

$queryid
$db
$userinfo

in vB_dB_Query_Create at line 76
setQuery($params, $sortorder)

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

Parameters

$params
$sortorder

in vB_dB_Query at line 386
setTableQuery($params, $sortorder)

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

Parameters

$params
$sortorder

in vB_dB_Query_Create at line 186
mixed execSQL()

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

Return Value

mixed

in vB_dB_Query at line 460
protected mixed buildQuery($values)

This function generates the query text against a table.

Parameters

$values

Return Value

mixed

in vB_dB_Query at line 580
debugDisplayNextQuerySql() deprecated

deprecated never worked quite right and now does nothing.

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

in vB_dB_Query at line 590
protected setQueryData(mixed $queryData)

Sets the query Query definitions

Parameters

mixed $queryData The query data from the querydefs

in vB_dB_Query at line 601
protected setTableData(mixed $tableData, string $queryid)

Sets the query Table definitions

Parameters

mixed $tableData The table data from the querydefs
string $queryid

in vB_dB_Query at line 616
protected setQueryDefs(object $querydefs)

Sets the querydef object

Parameters

object $querydefs The querydef object

in vB_dB_Query at line 627
protected setStructure(object $structure)

Sets the table structure.

Parameters

object $structure The querydef object