Andrew's Web Libraries (AWL)
|
Public Member Functions | |
__construct () | |
SetConnection ($new_connection, $options=null) | |
GetConnection () | |
_log_query ($locn, $tag, $string, $line=0, $file="") | |
Bind () | |
Prepare () | |
Execute () | |
QueryString () | |
Parameters () | |
rows () | |
rownum () | |
TransactionState () | |
Begin () | |
Commit () | |
Rollback () | |
SetSql ($sql) | |
QDo () | |
Exec ($location=null, $line=null, $file=null) | |
Fetch ($as_array=false) | |
getErrorInfo () | |
SetSlowQueryThreshold ($new_threshold) | |
Static Public Member Functions | |
static | quote ($str=null) |
Public Attributes | |
$location | |
$query_time_warning = 5 | |
Protected Attributes | |
$connection | |
$querystring | |
$bound_querystring | |
$bound_parameters | |
$sth | |
$result | |
$rownum = null | |
$rows | |
$error_info | |
$execution_time | |
Definition at line 117 of file AwlQuery.php.
AwlQuery::__construct | ( | ) |
#@- Constructor
string | The query string in PDO syntax with replacable '?' characters or bindable parameters. |
mixed | The values to replace into the SQL string. |
Definition at line 213 of file AwlQuery.php.
AwlQuery::_log_query | ( | $locn, | |
$tag, | |||
$string, | |||
$line = 0 , |
|||
$file = "" |
|||
) |
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(...);
string | $locn | A string identifying the calling location. |
string | $tag | A tag string, e.g. identifying the type of event. |
string | $string | The information to be logged. |
int | $line | The line number where the logged event occurred. |
string | $file | The file name where the logged event occurred. |
Definition at line 294 of file AwlQuery.php.
AwlQuery::Begin | ( | ) |
Wrap the parent DB class Begin() so we can $qry->Begin() sometime before we $qry->Exec()
Definition at line 472 of file AwlQuery.php.
AwlQuery::Bind | ( | ) |
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.
mixed | $args | See details above. |
Definition at line 335 of file AwlQuery.php.
AwlQuery::Commit | ( | ) |
Wrap the parent DB class Commit() so we can $qry->Commit() sometime after we $qry->Exec()
Definition at line 485 of file AwlQuery.php.
AwlQuery::Exec | ( | $location = null , |
|
$line = null , |
|||
$file = null |
|||
) |
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. $qry->Exec(CLASS, LINE, FILE);
string | $location | The name of the location for enabling debugging or just to help our children find the source of a problem. |
int | $line | The line number where Exec was called |
string | $file | The file where Exec was called |
Definition at line 561 of file AwlQuery.php.
AwlQuery::Execute | ( | ) |
Tell the database to execute the query
Definition at line 378 of file AwlQuery.php.
AwlQuery::Fetch | ( | $as_array = false | ) |
Fetch the next row from the query results
boolean | $as_array | True if thing to be returned is array |
Definition at line 627 of file AwlQuery.php.
AwlQuery::GetConnection | ( | ) |
Get the current database connection for this query
Definition at line 277 of file AwlQuery.php.
AwlQuery::getErrorInfo | ( | ) |
Get any error information from the last query
Definition at line 643 of file AwlQuery.php.
AwlQuery::Parameters | ( | ) |
Return the parameters we are planning to substitute into the query string
Definition at line 433 of file AwlQuery.php.
AwlQuery::Prepare | ( | ) |
Tell the database to prepare the query that we will execute
Definition at line 356 of file AwlQuery.php.
AwlQuery::QDo | ( | ) |
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...
string | The query string in PDO syntax with replacable '?' characters or bindable parameters. |
mixed | The values to replace into the SQL string. |
Definition at line 528 of file AwlQuery.php.
AwlQuery::QueryString | ( | ) |
Return the query string we are planning to execute
Definition at line 425 of file AwlQuery.php.
|
static |
Quote the given string so it can be safely used within string delimiters in a query. To be avoided, in general.
mixed | $str | Data to be converted to a string suitable for including as a value in SQL. |
Definition at line 316 of file AwlQuery.php.
AwlQuery::Rollback | ( | ) |
Wrap the parent DB class Rollback() so we can $qry->Rollback() sometime after we $qry->Exec()
Definition at line 496 of file AwlQuery.php.
AwlQuery::rownum | ( | ) |
Return the current rownum in the retrieved set
Definition at line 449 of file AwlQuery.php.
AwlQuery::rows | ( | ) |
Return the count of rows retrieved/affected
Definition at line 441 of file AwlQuery.php.
AwlQuery::SetConnection | ( | $new_connection, | |
$options = null |
|||
) |
Use a different database connection for this query
resource | $new_connection | The database connection to use. |
Definition at line 246 of file AwlQuery.php.
AwlQuery::SetSlowQueryThreshold | ( | $new_threshold | ) |
Set the slow query threshold for this query (and subsequent queries using this object). The overall default is $c->slow_query_threshold, or 5 seconds if that is not set.
double | $new_threshold | The new threshold for slow queries to be logged |
Definition at line 654 of file AwlQuery.php.
AwlQuery::SetSql | ( | $sql | ) |
Simple SetSql() class which will reset the object with the querystring from the first argument.
string | The query string in PDO syntax with replacable '?' characters or bindable parameters. |
Definition at line 508 of file AwlQuery.php.
AwlQuery::TransactionState | ( | ) |
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.
Definition at line 459 of file AwlQuery.php.