Methods summary
public
boolean
|
#
bindColumn( string $column, mixed & $param, mixed $type = null )
Bind a column of the statement result set to a PHP variable.
Bind a column of the statement result set to a PHP variable.
Parameters
- $column
string Name the column in the result set, either by position or by name.
- $param
mixed Reference to the PHP variable containing the value.
- $type
mixed OPTIONAL
Returns
boolean
Throws
|
public
boolean
|
#
bindParam( mixed $parameter, mixed & $variable, mixed $type = null, mixed $length = null, mixed $options = null )
Binds a parameter to the specified variable name.
Binds a parameter to the specified variable name.
Parameters
- $parameter
mixed Name the parameter, either integer or string.
- $variable
mixed Reference to PHP variable containing the value.
- $type
mixed OPTIONAL Datatype of SQL parameter.
- $length
mixed OPTIONAL Length of SQL parameter.
- $options
mixed OPTIONAL Other options.
Returns
boolean
Throws
|
public
boolean
|
#
bindValue( mixed $parameter, mixed $value, mixed $type = null )
Binds a value to a parameter.
Binds a value to a parameter.
Parameters
- $parameter
mixed Name the parameter, either integer or string.
- $value
mixed Scalar value to bind to the parameter.
- $type
mixed OPTIONAL Datatype of the parameter.
Returns
boolean
Throws
|
public
boolean
|
#
closeCursor( )
Closes the cursor, allowing the statement to be executed again.
Closes the cursor, allowing the statement to be executed again.
Returns
boolean
Throws
|
public
integer
|
#
columnCount( )
Returns the number of columns in the result set. Returns null if the
statement has no result set metadata.
Returns the number of columns in the result set. Returns null if the
statement has no result set metadata.
Returns
integer The number of columns.
Throws
|
public
string
|
#
errorCode( )
Retrieves the error code, if any, associated with the last operation on the
statement handle.
Retrieves the error code, if any, associated with the last operation on the
statement handle.
Returns
string error code.
Throws
|
public
array
|
#
errorInfo( )
Retrieves an array of error information, if any, associated with the last
operation on the statement handle.
Retrieves an array of error information, if any, associated with the last
operation on the statement handle.
Returns
array
Throws
|
public
boolean
|
#
execute( array $params = array() )
Executes a prepared statement.
Executes a prepared statement.
Parameters
- $params
array OPTIONAL Values to bind to parameter placeholders.
Returns
boolean
Throws
|
public
mixed
|
#
fetch( integer $style = null, integer $cursor = null, integer $offset = null )
Fetches a row from the result set.
Fetches a row from the result set.
Parameters
- $style
integer OPTIONAL Fetch mode for this fetch operation.
- $cursor
integer OPTIONAL Absolute, relative, or other.
- $offset
integer OPTIONAL Number for absolute or relative cursors.
Returns
mixed Array, object, or scalar depending on fetch mode.
Throws
|
public
array
|
#
fetchAll( integer $style = null, integer $col = null )
Returns an array containing all of the result set rows.
Returns an array containing all of the result set rows.
Parameters
- $style
integer OPTIONAL Fetch mode.
- $col
integer OPTIONAL Column number, if fetch mode is by column.
Returns
array Collection of rows, each in a format by the fetch mode.
Throws
|
public
string
|
#
fetchColumn( integer $col = 0 )
Returns a single column from the next row of a result set.
Returns a single column from the next row of a result set.
Parameters
- $col
integer OPTIONAL Position of the column to fetch.
Returns
string
Throws
|
public
mixed
|
#
fetchObject( string $class = 'stdClass', array $config = array() )
Fetches the next row and returns it as an object.
Fetches the next row and returns it as an object.
Parameters
- $class
string OPTIONAL Name of the class to create.
- $config
array OPTIONAL Constructor arguments for the class.
Returns
mixed One object instance of the specified class.
Throws
|
public
mixed
|
#
getAttribute( string $key )
Retrieve a statement attribute.
Retrieve a statement attribute.
Parameters
- $key
string Attribute name.
Returns
mixed Attribute value.
Throws
|
public
boolean
|
#
nextRowset( )
Retrieves the next rowset (result set) for a SQL statement that has multiple
result sets. An example is a stored procedure that returns the results of
multiple queries.
Retrieves the next rowset (result set) for a SQL statement that has multiple
result sets. An example is a stored procedure that returns the results of
multiple queries.
Returns
boolean
Throws
|
public
integer
|
#
rowCount( )
Returns the number of rows affected by the execution of the last INSERT,
DELETE, or UPDATE statement executed by this statement object.
Returns the number of rows affected by the execution of the last INSERT,
DELETE, or UPDATE statement executed by this statement object.
Returns
integer The number of rows affected.
Throws
|
public
boolean
|
#
setAttribute( string $key, mixed $val )
Set a statement attribute.
Set a statement attribute.
Parameters
- $key
string Attribute name.
- $val
mixed Attribute value.
Returns
boolean
Throws
|
public
boolean
|
#
setFetchMode( integer $mode )
Set the default fetch mode for this statement.
Set the default fetch mode for this statement.
Parameters
- $mode
integer The fetch mode.
Returns
boolean
Throws
|