AwlQueryThe AwlQuery Class.
This class builds and executes SQL Queries and traverses the set of results returned from the query.
Example usage
Located in /AwlQuery.php (line 117)
array
$bound_parameters
(line 144)
The current array of bound parameters
string
$bound_querystring
(line 138)
The actual query string, after we've replaced parameters in it
resource
$connection
(line 126)
Our database connection, normally copied from a global one
string
$error_info
(line 174)
The Database error information, if the query fails.
string
$execution_time
(line 181)
Stores the query execution time - used to deal with long queries.
should be read-only
string
$location
(line 193)
Where we called this query from so we can find it in our code! Debugging may also be selectively enabled for a $location.
string
$querystring
(line 132)
The original query string
double
$query_time_warning
= 0.3 (line 202)
How long the query should take before a warning is issued.
This is writable, but a method to set it might be a better interface. The default is 0.3 seconds.
resource
$result
(line 156)
Result of the last execution
int
$rownum
= null (line 162)
number of current row - use accessor to get/set
int
$rows
(line 168)
number of rows from pg_numrows - use accessor to get value
string
$sth
(line 150)
The PDO statement handle, or null if we don't have one yet.
Constructor __construct (line 212)
Constructor
Begin (line 451)
Wrap the parent DB class Begin() so we can $qry->Begin() sometime before we $qry->Exec()
Bind (line 323)
Bind some parameters. This can be called in three ways:
1) As Bind(':key','value), when using named parameters 2) As Bind('value'), when using ? placeholders 3) As Bind(array()), to overwrite the existing bound parameters. The array may be ':name' => 'value' pairs or ordinal values, depending on whether the SQL is using ':name' or '?' style placeholders.
Commit (line 464)
Wrap the parent DB class Commit() so we can $qry->Commit() sometime after we $qry->Exec()
Exec (line 540)
Execute the query, logging any debugging.
Example So that you can nicely enable/disable the queries for a particular class, you could use some of PHPs magic constants in your call.
Execute (line 367)
Tell the database to execute the query
Fetch (line 604)
Fetch the next row from the query results
Parameters (line 421)
Return the parameters we are planning to substitute into the query string
Prepare (line 344)
Tell the database to prepare the query that we will execute
QDo (line 507)
Simple QDo() class which will re-use this query for whatever was passed in, and execute it returning the result of the Exec() call. We can't call it Do() since that's a reserved word...
QueryString (line 413)
Return the query string we are planning to execute
quote (line 304)
Quote the given string so it can be safely used within string delimiters in a query. To be avoided, in general.
Rollback (line 475)
Wrap the parent DB class Rollback() so we can $qry->Rollback() sometime after we $qry->Exec()
rows (line 429)
Return the count of rows retrieved/affected
SetConnection (line 241)
Use a different database connection for this query
SetSql (line 487)
Simple SetSql() class which will reset the object with the querystring from the first argument.
TransactionState (line 438)
Returns the current state of a transaction, indicating if we have begun a transaction, whether the transaction has failed, or if we are not in a transaction.
_log_query (line 282)
Log query, optionally with file and line location of the caller.
This function should not really be used outside of AwlQuery. For a more useful generic logging interface consider calling dbg_error_log(...);
Documentation generated on Mon, 20 Sep 2010 12:52:17 +1200 by phpDocumentor 1.4.3