KEY
KEY
Convenience class for creating sql queries - also the class that instantiates the specific db driver
$db : \Query\Driver\Driver_Interface
The current database driver
$parser : \Query\Query_Parser
Query parser class instance
__construct(\Query\Driver\Driver_Interface $db, \Query\Query_Parser $parser)
Constructor
\Query\Driver\Driver_Interface | $db | |
\Query\Query_Parser | $parser |
select(string $fields) : \Query\Query_Builder
Specifies rows to select in a query
string | $fields |
select_max(string $field, string|FALSE $as) : \Query\Query_Builder
Selects the maximum value of a field from a query
string | $field | |
string|FALSE | $as |
select_min(string $field, string|bool $as) : \Query\Query_Builder
Selects the minimum value of a field from a query
string | $field | |
string|bool | $as |
select_avg(string $field, string|bool $as) : \Query\Query_Builder
Selects the average value of a field from a query
string | $field | |
string|bool | $as |
select_sum(string $field, string|bool $as) : \Query\Query_Builder
Selects the sum of a field from a query
string | $field | |
string|bool | $as |
distinct() : \Query\Query_Builder
Adds the 'distinct' keyword to a query
explain() : \Query\Query_Builder
Tell the database to give you the query plan instead of result set
from(string $tblname) : \Query\Query_Builder
Specify the database table to select from
string | $tblname |
like(string $field, mixed $val, string $pos) : \Query\Query_Builder
Creates a Like clause in the sql statement
string | $field | |
mixed | $val | |
string | $pos |
or_like(string $field, mixed $val, string $pos) : \Query\Query_Builder
Generates an OR Like clause
string | $field | |
mixed | $val | |
string | $pos |
not_like(string $field, mixed $val, string $pos) : \Query\Query_Builder
Generates a NOT LIKE clause
string | $field | |
mixed | $val | |
string | $pos |
or_not_like(string $field, mixed $val, string $pos) : \Query\Query_Builder
Generates a OR NOT LIKE clause
string | $field | |
mixed | $val | |
string | $pos |
having(mixed $key, mixed $val) : \Query\Query_Builder
Generates a 'Having' clause
mixed | $key | |
mixed | $val |
or_having(mixed $key, mixed $val) : \Query\Query_Builder
Generates a 'Having' clause prefixed with 'OR'
mixed | $key | |
mixed | $val |
where(mixed $key, mixed $val, mixed $escape) : \Query\Query_Builder
Specify condition(s) in the where clause of a query Note: this function works with key / value, or a passed array with key / value pairs
mixed | $key | |
mixed | $val | |
mixed | $escape |
or_where(string $key, mixed $val) : \Query\Query_Builder
Where clause prefixed with "OR"
string | $key | |
mixed | $val |
where_in(mixed $field, mixed $val) : \Query\Query_Builder
Where clause with 'IN' statement
mixed | $field | |
mixed | $val |
or_where_in(string $field, mixed $val) : \Query\Query_Builder
Where in statement prefixed with "or"
string | $field | |
mixed | $val |
where_not_in(string $field, mixed $val) : \Query\Query_Builder
WHERE NOT IN (FOO) clause
string | $field | |
mixed | $val |
or_where_not_in(string $field, mixed $val) : \Query\Query_Builder
OR WHERE NOT IN (FOO) clause
string | $field | |
mixed | $val |
set(mixed $key, mixed $val) : \Query\Query_Builder
Sets values for inserts / updates / deletes
mixed | $key | |
mixed | $val |
join(string $table, string $condition, string $type) : \Query\Query_Builder
Creates a join phrase in a compiled query
string | $table | |
string | $condition | |
string | $type |
group_by(mixed $field) : \Query\Query_Builder
Group the results by the selected field(s)
mixed | $field |
order_by(string $field, string $type) : \Query\Query_Builder
Order the results by the selected field(s)
string | $field | |
string | $type |
limit(int $limit, int|bool $offset) : \Query\Query_Builder
Set a limit on the current sql statement
int | $limit | |
int|bool | $offset |
group_start() : \Query\Query_Builder
Adds a paren to the current query for query grouping
or_group_start() : \Query\Query_Builder
Adds a paren to the current query for query grouping, prefixed with 'OR'
or_not_group_start() : \Query\Query_Builder
Adds a paren to the current query for query grouping, prefixed with 'OR NOT'
group_end() : \Query\Query_Builder
Ends a query group
_like(string $field, mixed $val, string $pos, string $like, string $conj) : \Query\Query_Builder
Simplify 'like' methods
string | $field | |
mixed | $val | |
string | $pos | |
string | $like | |
string | $conj |
_having(mixed $key, mixed $val, string $conj) : \Query\Query_Builder
Simplify building having clauses
mixed | $key | |
mixed | $val | |
string | $conj |
_where_string(mixed $key, mixed $val, string $conj) : \Query\Query_Builder
Simplify generating where string
mixed | $key | |
mixed | $val | |
string | $conj |
_where_in(mixed $key, mixed $val, string $in, string $conj) : \Query\Query_Builder
Simplify where_in methods
mixed | $key | |
mixed | $val | |
string | $in |
|
string | $conj |
|