AwlQueryThe 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)
array
$bound_parameters
(line 159)
The current array of bound parameters
resource
$connection
(line 147)
Our database connection, normally copied from a global one
string
$error_info
(line 189)
The Database error information, if the query fails.
string
$execution_time
(line 196)
Stores the query execution time - used to deal with long queries.
should be read-only
string
$location
(line 208)
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 153)
The original query string
double
$query_time_warning
= 0.3 (line 217)
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 171)
Result of the last execution
int
$rownum
= null (line 177)
number of current row - use accessor to get/set
int
$rows
(line 183)
number of rows from pg_numrows - use accessor to get value
string
$sth
(line 165)
The PDO statement handle, or null if we don't have one yet.
Constructor __construct (line 227)
Constructor
Bind (line 307)
Bind some parameters
Exec (line 377)
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 (line 453)
Fetch the next row from the query results
Parameters (line 347)
Return the parameters we are planning to substitute into the query string
Prepare (line 323)
Tell the database to prepare the query that we will execute
QueryString (line 339)
Return the query string we are planning to execute
quote (line 295)
Quote the given string so it can be safely used within string delimiters in a query. To be avoided, in general.
rows (line 355)
Return the count of rows retrieved/affected
SetConnection (line 255)
Use a different database connection for this query
_log_query (line 273)
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 Thu, 25 Feb 2010 11:39:17 +1300 by phpDocumentor 1.3.2