Namespace: RedBeanPHP
Copyright:
copyright (c) G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community
This source file is subject to the BSD/GPLv2 License that is bundled
with this source code in the file license.txt.
License:
BSD/GPLv2
Author:
Gabor de Mooij and the RedBeanPHP Community
File:
RedBeanPHP/Driver.php
Located at Driver.php
Methods summary
public
array
|
#
GetAll( string $sql, array $bindings = array() )
Runs a query and fetches results as a multi dimensional array.
Runs a query and fetches results as a multi dimensional array.
Parameters
- $sql
- SQL query to execute
- $bindings
- list of values to bind to SQL snippet
Returns
array
|
public
array
|
#
GetCol( string $sql, array $bindings = array() )
Runs a query and fetches results as a column.
Runs a query and fetches results as a column.
Parameters
- $sql
- SQL query to execute
- $bindings
- list of values to bind to SQL snippet
Returns
array
|
public
mixed
|
#
GetOne( string $sql, array $bindings = array() )
Runs a query and returns results as a single cell.
Runs a query and returns results as a single cell.
Parameters
- $sql
- SQL query to execute
- $bindings
- list of values to bind to SQL snippet
Returns
mixed
|
public
mixed
|
#
GetAssocRow( string $sql, array $bindings = array() )
Runs a query and returns results as an associative array
indexed by the first column.
Runs a query and returns results as an associative array
indexed by the first column.
Parameters
- $sql
- SQL query to execute
- $bindings
- list of values to bind to SQL snippet
Returns
mixed
|
public
array
|
#
GetRow( string $sql, array $bindings = array() )
Runs a query and returns a flat array containing the values of
one row.
Runs a query and returns a flat array containing the values of
one row.
Parameters
- $sql
- SQL query to execute
- $bindings
- list of values to bind to SQL snippet
Returns
array
|
public
array
|
#
Execute( string $sql, array $bindings = array() )
Executes SQL code and allows key-value binding.
This function allows you to provide an array with values to bind
to query parameters. For instance you can bind values to question
marks in the query. Each value in the array corresponds to the
question mark in the query that matches the position of the value in the
array. You can also bind values using explicit keys, for instance
array(":key"=>123) will bind the integer 123 to the key :key in the
SQL. This method has no return value.
Executes SQL code and allows key-value binding.
This function allows you to provide an array with values to bind
to query parameters. For instance you can bind values to question
marks in the query. Each value in the array corresponds to the
question mark in the query that matches the position of the value in the
array. You can also bind values using explicit keys, for instance
array(":key"=>123) will bind the integer 123 to the key :key in the
SQL. This method has no return value.
Parameters
- $sql
- SQL query to execute
- $bindings
- list of values to bind to SQL snippet
Returns
array Affected Rows
|
public
integer
|
#
GetInsertID( )
Returns the latest insert ID if driver does support this
feature.
Returns the latest insert ID if driver does support this
feature.
Returns
integer
|
public
integer
|
#
Affected_Rows( )
Returns the number of rows affected by the most recent query
if the currently selected driver driver supports this feature.
Returns the number of rows affected by the most recent query
if the currently selected driver driver supports this feature.
Returns
integer
|
public
mixed
|
#
GetCursor( string $sql, array $bindings = array() )
Returns a cursor-like object from the database.
Returns a cursor-like object from the database.
Parameters
- $sql
- SQL query to execute
- $bindings
- list of values to bind to SQL snippet
Returns
mixed
|
public
|
#
setDebugMode( boolean $tf, RedBeanPHP\Logger $customLogger )
Toggles debug mode. In debug mode the driver will print all
SQL to the screen together with some information about the
results. All SQL code that passes through the driver will be
passes on to the screen for inspection.
This method has no return value.
Toggles debug mode. In debug mode the driver will print all
SQL to the screen together with some information about the
results. All SQL code that passes through the driver will be
passes on to the screen for inspection.
This method has no return value.
Parameters
- $tf
- TRUE = debug mode ON
- $customLogger
|
public
|
|
public
|
|
public
|
#
FailTrans( )
Rolls back a transaction.
Rolls back a transaction.
|
public
RedBeanPHP\Driver
|
#
resetCounter( )
Resets the internal Query Counter.
Resets the internal Query Counter.
Returns
|
public
integer
|
#
getQueryCount( )
Returns the number of SQL queries processed.
Returns the number of SQL queries processed.
Returns
integer
|