Public Member Functions | |
setLimit ($v) | |
Sets the maximum number of rows to return from db. | |
getLimit () | |
Returns the maximum number of rows to return or 0 for all. | |
setOffset ($v) | |
Sets the start row. | |
getOffset () | |
Returns the start row. | |
close () | |
Free resources associated with this statement. | |
execute ($sql, $fetchmode=null) | |
Generic execute() function has to check to see whether SQL is an update or select query. | |
getResultSet () | |
Get result set. | |
getUpdateCount () | |
Get update count. | |
executeQuery ($sql, $fetchmode=null) | |
Executes the SQL query in this PreparedStatement object and returns the resultset generated by the query. | |
executeUpdate ($sql) | |
Executes the SQL INSERT, UPDATE, or DELETE statement in this PreparedStatement object. | |
getMoreResults () | |
Gets next result set (if this behavior is supported by driver). | |
getConnection () | |
Gets the db Connection that created this statement. |
Definition at line 36 of file Statement.php.
Statement::close | ( | ) |
Free resources associated with this statement.
Some drivers will need to implement this method to free database result resources.
Statement::execute | ( | $ | sql, | |
$ | fetchmode = null | |||
) |
Generic execute() function has to check to see whether SQL is an update or select query.
If you already know whether it's a SELECT or an update (manipulating) SQL, then use the appropriate method, as this one will incurr overhead to check the SQL.
int | $fetchmode Fetchmode (only applies to queries). |
SQLException |
Statement::executeQuery | ( | $ | sql, | |
$ | fetchmode = null | |||
) |
Executes the SQL query in this PreparedStatement object and returns the resultset generated by the query.
string | $sql This method may optionally be called with the SQL statement. | |
int | $fetchmode The mode to use when fetching the results (e.g. ResultSet::FETCHMODE_NUM, ResultSet::FETCHMODE_ASSOC). |
SQLException | if a database access error occurs. |
Implemented in MSSQLStatement, and ODBCStatement.
Statement::executeUpdate | ( | $ | sql | ) |
Executes the SQL INSERT, UPDATE, or DELETE statement in this PreparedStatement object.
string | $sql This method may optionally be called with the SQL statement. |
SQLException | if a database access error occurs. |
Statement::getConnection | ( | ) |
Statement::getLimit | ( | ) |
Returns the maximum number of rows to return or 0 for all.
Statement::getMoreResults | ( | ) |
Gets next result set (if this behavior is supported by driver).
Some drivers (e.g. MSSQL) support returning multiple result sets -- e.g. from stored procedures.
This function also closes any current restult set.
Default behavior is for this function to return false. Driver-specific implementations of this class can override this method if they actually support multiple result sets.
Implemented in MSSQLStatement.
Statement::getOffset | ( | ) |
Returns the start row.
Offset only applies when Limit is set!
Statement::getResultSet | ( | ) |
Get result set.
This assumes that the last thing done was an executeQuery() or an execute() with SELECT-type query.
Statement::getUpdateCount | ( | ) |
Get update count.
null
if not applicable. Statement::setLimit | ( | $ | v | ) |
Sets the maximum number of rows to return from db.
This will affect the SQL if the RDBMS supports native LIMIT; if not, it will be emulated. Limit only applies to queries (not update sql).
int | $v Maximum number of rows or 0 for all rows. |
Statement::setOffset | ( | $ | v | ) |
Sets the start row.
This will affect the SQL if the RDBMS supports native OFFSET; if not, it will be emulated. Offset only applies to queries (not update) and only is evaluated when LIMIT is set!
int | $v |