Methods summary
public
string
|
#
fetchColumn( string $sQuery, integer $iColumnNumber = 0 )
Returns content of specified column of the first row of query's result.
Returns content of specified column of the first row of query's result.
Parameters
- $sQuery
string $sQuery Query to execute.
- $iColumnNumber
integer $iColumnNumber 0-indexed number of the column you wish to retrieve from the row.
If no value is supplied, PDOStatement::fetchColumn() fetches the first column.
Returns
string content of specified column of the first row of query's result
|
public
array
|
#
fetchRow( string $sQuery )
Fetches the first row of of the specified SQL statement. The row is an array
indexed by column name. If a result set row contains multiple columns with the
same name, then returns only a single value per column name.
Fetches the first row of of the specified SQL statement. The row is an array
indexed by column name. If a result set row contains multiple columns with the
same name, then returns only a single value per column name.
Parameters
- $sQuery
string $sQuery Statement to execute.
Returns
array returns the first row of of the specified SQL statement.
|
public
array
|
#
fetchAll( string $sQuery )
Returns an array containing all of the result set rows of the specified SQL
statement. Each row is an array indexed by column name. If a result set row
contains multiple columns with the same name, then returns only a single value
per column name.
Returns an array containing all of the result set rows of the specified SQL
statement. Each row is an array indexed by column name. If a result set row
contains multiple columns with the same name, then returns only a single value
per column name.
Parameters
- $sQuery
string $sQuery Statement to execute.
Returns
array returns an array containing all of the remaining rows in the result set. The
array represents each row as an array of column values.
|
public
PDOStatement
|
#
query( string $sQuery )
Executes the specified SQL statement, returning a result set as a
PDOStatement object.
Executes the specified SQL statement, returning a result set as a
PDOStatement object.
Parameters
- $sQuery
string $sQuery Statement to execute.
Returns
PDOStatement a PDOStatement object
Throws
PDOException on error
|
public
integer
|
#
exec( string $sQuery )
Execute an SQL statement and return the number of affected rows.
Execute an SQL statement and return the number of affected rows.
Parameters
- $sQuery
string $sQuery The SQL statement to prepare and execute.
Returns
integer the number of rows that were modified or deleted by the SQL statement. If no
rows were affected returns 0.
Throws
PDOException on error
|
public
PDOStatement
|
#
prepare( string $sQuery )
Prepares a statement for execution and returns a statement object.
Prepares a statement for execution and returns a statement object.
Emulated prepared statements does not communicate with the database server so
prepare() does not check the statement.
Parameters
- $sQuery
string $sQuery SQL statement
Returns
PDOStatement a PDOStatement object.
Throws
PDOException if error
|
public
|
|
public
string
|
#
lastInsertId( string $sSequenceName = null )
Returns the ID of the last inserted row or sequence value.
Returns the ID of the last inserted row or sequence value.
Parameters
- $sSequenceName
string $sSequenceName [optional] Name of the sequence object from which the ID should
be returned.
Returns
string If a sequence name was not specified returns a string representing the row ID of
the last row that was inserted into the database, else returns a string
representing the last value retrieved from the specified sequence object.
|
public
string
|
#
quote( string $sValue, integer $iType = \PDO::PARAM_STR )
Quotes a string for use in a query.
Quotes a string for use in a query.
Parameters
- $sValue
string $sValue The string to be quoted.
- $iType
integer $iType [optional] Provides a data type hint for drivers that have alternate
quoting styles.
Returns
string a quoted string that is theoretically safe to pass into an SQL statement.
Returns FALSE if the driver does not support quoting in this way.
|
public
boolean
|
#
beginTransaction( )
Initiates a transaction.
Returns
boolean TRUE on success or FALSE on failure.
|
public
boolean
|
#
rollBack( )
Rolls back a transaction.
Rolls back a transaction.
Returns
boolean TRUE on success or FALSE on failure.
|
public
boolean
|
#
commit( )
Commits a transaction.
Returns
boolean TRUE on success or FALSE on failure.
|
public
|
|