Class

DBQuerier

Package: IO\DB Copyright: © 2005-2019 PHPBoost License: GNU/GPL-3.0 Author: Loic ROUCHON horn@phpboost.com Version: PHPBoost 5.2 - last update: 2014 12 22 Since: PHPBoost 3.0 - 2009 10 05 Located at: io/db/DBQuerier.class.php

implements some simple queries

DBQuerier implements SQLQuerier
Methods summary
public
# __construct( SQLQuerier $querier )
public SelectQueryResult
# select( string $query, string[string] $parameters = array(), $fetch_mode = SelectQueryResult::FETCH_ASSOC )

executes the

$query

sql request and returns the query result.

Query will first be converted into the specific sgbd dialect.

Next query functions will be converted into the specific sgbd dialect.

Then query vars ":sample_query_var" will be replaced by the value of the

$parameters['sample_query_var']
variable if existing. If not (there's a lot of chance that you have forgotten to register this query var in the
$parameters
map), the query var won't be replaced

public InjectQueryResult
# inject( string $query, string[string] $parameters = array() )

executes the

$query

sql request.

Query will first be converted into the specific sgbd dialect.

Next query functions will be converted into the specific sgbd dialect.

Then query vars ":sample_query_var" will be replaced by the value of the

$parameters['sample_query_var']
variable if existing. If not (there's a lot of chance that you have forgotten to register this query var in the
$parameters
map), the query var won't be replaced

public
public
public
public
# truncate( string $table_name )

Removes all table rows

public InjectQueryResult
# insert( string $table_name, array $columns )

insert the values into the

$table_name

table

public InjectQueryResult
# update( string $table_name, array $columns, string $condition, array $parameters = array() )

update the values of rows matching the

$condition

into the

$table_name

table

public
# delete( string $table_name, string $condition, array $parameters = array() )

delete all the row from the

$table_name

table matching the

$condition

condition

public mixed[string]
# select_single_row( string $table_name, array $columns, string $condition, array $parameters = array() )

retrieve a single row from the

$table_name

table matching the

$condition

condition

public mixed
# select_single_row_query( string $query, string[string] $parameters = array() )

retrieve a single row for executes the

$query

sql request and returns row

public boolean
# row_exists( string $table_name, string $condition, array $parameters = array() )

Returns true if a or multiple rows match the given condition.

public mixed
# get_column_value( string $table_name, string $column, string $condition, array $parameters = array() )

retrieve a single value of the

$column

column of a single row from the

$table_name

table matching the

$condition

condition.

public mixed[string]
# select_rows( string $table_name, array $columns, string $condition = 'WHERE 1', string[string] $parameters = array() )

retrieve rows from the

$table_name

table matching the

$condition

condition

public integer
# count( string $table_name, string $condition = 'WHERE 1', string $parameters = array(), string[string] $count_column = '*' )

count the number of rows from the

$table_name

table matching the

$condition

condition

public
Constants inherited from SQLQuerier
ORDER_BY_ASC, ORDER_BY_DESC