Free resources associated with this statement.
Some drivers will need to implement this method to free database result resources.
Tags:
boolean execute(
mixed
$sql, [int
$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.
Tags:
Parameters:
boolean 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.
Tags:
Overridden in child classes as:
- MSSQLStatement::getMoreResults()
- Gets next result set (if this behavior is supported by driver).
boolean isSelect(
string
$sql)
|
|
Returns whether the passed SQL is a SELECT statement.
Returns true if SQL starts with 'SELECT' but not 'SELECT INTO'. This exists to support the execute() function -- which could either execute an update or a query.
Currently this function does not take into consideration comments, primarily because there are a number of different comment options for different drivers:
-- SQL-defined comment, but not truly comment in Oracle
# comment in mysql
/* comment in mssql, others * /
// comment sometimes?
REM also comment ...
If you're wondering why we can't just execute the query and look at the return results to see whether it was an update or a select, the reason is that for update queries we need to do stuff before we execute them -- like start transactions if auto-commit is off.
Tags:
Parameters:
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).
Tags:
Parameters: