The AwlQuery Class.
This class builds and executes SQL Queries and traverses the set of results returned from the query.
Example usage
Located in /inc/AwlQuery.php (line 138)
The current array of bound parameters
Our database connection, normally copied from a global one
The Database error information, if the query fails.
Stores the query execution time - used to deal with long queries.
should be read-only
Where we called this query from so we can find it in our code! Debugging may also be selectively enabled for a $location.
The original query string
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.
Result of the last execution
number of current row - use accessor to get/set
number of rows from pg_numrows - use accessor to get value
The PDO statement handle, or null if we don't have one yet.
Constructor
Wrap the parent DB class Begin() so we can $qry->Begin() sometime before we $qry->Exec()
Bind some parameters
Wrap the parent DB class Commit() so we can $qry->Commit() sometime after we $qry->Exec()
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.
Fetch the next row from the query results
Return the parameters we are planning to substitute into the query string
Tell the database to prepare the query that we will execute
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...
Return the query string we are planning to execute
Quote the given string so it can be safely used within string delimiters in a query. To be avoided, in general.
Wrap the parent DB class Rollback() so we can $qry->Rollback() sometime after we $qry->Exec()
Return the count of rows retrieved/affected
Use a different database connection for this query
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 Tue, 09 Mar 2010 10:08:41 +1300 by phpDocumentor 1.3.2