Statement
public interface Statement
www.doctrine-project.org
Method Summary | |
---|---|
boolean | bindParam(mixed column, mixed variable, integer type, mixed param) Binds a PHP variable to a corresponding named or question mark placeholder in the SQL statement that was use to prepare the statement. |
boolean | bindValue(mixed param, mixed value, integer type) Binds a value to a corresponding named or positional placeholder in the SQL statement that was used to prepare the statement. |
boolean | Closes the cursor, enabling the statement to be executed again. |
integer | columnCount Returns the number of columns in the result set |
string | errorCode Fetch the SQLSTATE associated with the last operation on the statement handle |
array | errorInfo Fetch extended error information associated with the last operation on the statement handle |
boolean | execute(array params) Executes a prepared statementIf 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 |
mixed | fetch(integer fetchStyle, integer cursorOrientation, integer cursorOffset) fetch |
array | fetchAll(integer fetchStyle, integer columnIndex) Returns an array containing all of the result set rows |
string | fetchColumn(integer columnIndex) fetchColumn Returns a single column from the next row of a result set or FALSE if there are no more rows. |
integer | rowCount() rowCount rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement executed by the corresponding object. |
public boolean bindParam(mixed column, mixed variable, integer type, mixed param)
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.
public boolean bindValue(mixed param, mixed value, integer type)
Binds a value to a corresponding named or positional placeholder in the SQL statement that was used to prepare the statement.
public boolean closeCursor()
Closes the cursor, enabling the statement to be executed again.
public integer columnCount()
columnCount Returns the number of columns in the result set
public string errorCode()
errorCode Fetch the SQLSTATE associated with the last operation on the statement handle
public array errorInfo()
errorInfo Fetch extended error information associated with the last operation on the statement handle
public boolean execute(array params)
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
public mixed fetch(integer fetchStyle, integer cursorOrientation, integer cursorOffset)
fetch
public array fetchAll(integer fetchStyle, integer columnIndex)
Returns an array containing all of the result set rows
public string fetchColumn(integer columnIndex)
fetchColumn Returns a single column from the next row of a result set or FALSE if there are no more rows.
public integer rowCount()
rowCount rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement executed by the corresponding 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.
Statement interface. Drivers must implement this interface.
This resembles (a subset of) the PDOStatement interface.