interface StatementInterface
Interface for Propel Connection object.
Based on the PDOStatement interface.
Methods
boolean |
bindParam(mixed $column, mixed $variable, integer $type = null)
Binds a parameter to the specified variable name. |
|
boolean |
bindValue(mixed $param, mixed $value, integer $type = null)
Binds a value to a parameter. |
|
boolean |
closeCursor()
Closes the cursor, enabling the statement to be executed again. |
|
integer |
columnCount()
Returns the number of columns in the result set. |
|
boolean |
execute(array $params = null)
Executes a prepared statement. |
|
mixed |
fetch($fetchStyle = 4)
Fetches the next row from a result set. |
|
array |
fetchAll(integer $fetchStyle = 4)
Returns an array containing all of the result set rows. |
|
string |
fetchColumn(integer $columnIndex)
Returns a single column from the next row of a result set. |
|
integer |
rowCount()
Returns the number of rows affected by the last SQL statement |
Details
at line 46
public boolean
bindParam(mixed $column, mixed $variable, integer $type = null)
Binds a parameter to the specified variable name.
Binds a PHP variable to a corresponding named or question mark placeholder in the
SQL statement that was use to prepare the statement. Unlike PDOStatement->bindValue(),
the variable is bound as a reference and will only be evaluated at the time
that PDOStatement->execute() is called.
Most parameters are input parameters, that is, parameters that are
used in a read-only fashion to build up the query. Some drivers support the invocation
of stored procedures that return data as output parameters, and some also as input/output
parameters that both send in data and are updated to receive it.
at line 63
public boolean
bindValue(mixed $param, mixed $value, integer $type = null)
Binds a value to a parameter.
Binds a value to a corresponding named or question mark placeholder
in the SQL statement that was used to prepare the statement.
at line 79
public boolean
closeCursor()
Closes the cursor, enabling the statement to be executed again.
closeCursor() frees up the connection to the server so that other SQL
statements may be issued, but leaves the statement in a state that enables
it to be executed again.
This method is useful for database drivers that do not support executing
a PDOStatement object when a previously executed PDOStatement object still
has unfetched rows. If your database driver suffers from this limitation,
the problem may manifest itself in an out-of-sequence error.
at line 98
public integer
columnCount()
Returns the number of columns in the result set.
Use columnCount() to return the number of columns in the result set
represented by the Statement object.
If the Statement object was returned from PDO::query(), the column count
is immediately available.
If the Statement object was returned from PDO::prepare(), an accurate
column count will not be available until you invoke Statement::execute().
Returns the number of columns in the result set
at line 114
public boolean
execute(array $params = null)
Executes a prepared statement.
If the prepared statement included parameter markers, you must either:
- call PDOStatement->bindParam() to bind PHP variables to the parameter markers:
bound variables pass their value as input and receive the output value,
if any, of their associated parameter markers
- or pass an array of input-only parameter values
at line 139
public mixed
fetch($fetchStyle = 4)
Fetches the next row from a result set.
Fetches a row from a result set associated with a Statement object.
The fetch_style parameter determines how the Connection returns the row.
at line 147
public array
fetchAll(integer $fetchStyle = 4)
Returns an array containing all of the result set rows.
at line 158
public string
fetchColumn(integer $columnIndex)
Returns a single column from the next row of a result set.
at line 173
public integer
rowCount()
Returns the number of rows affected by the last SQL statement
rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement
executed by the corresponding Statement object.
If the last SQL statement executed by the associated Statement object was a SELECT statement,
some databases may return the number of rows returned by that statement. However,
this behaviour is not guaranteed for all databases and should not be
relied on for portable applications.