|
Andrew's Web Libraries (AWL) 0.64
|
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 | |
| $location_line | |
| $location_file | |
| $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 215 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 296 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 474 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 337 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 487 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 563 of file AwlQuery.php.
| AwlQuery::Execute | ( | ) |
Tell the database to execute the query
Definition at line 380 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 629 of file AwlQuery.php.
| AwlQuery::GetConnection | ( | ) |
Get the current database connection for this query
Definition at line 279 of file AwlQuery.php.
| AwlQuery::getErrorInfo | ( | ) |
Get any error information from the last query
Definition at line 645 of file AwlQuery.php.
| AwlQuery::Parameters | ( | ) |
Return the parameters we are planning to substitute into the query string
Definition at line 435 of file AwlQuery.php.
| AwlQuery::Prepare | ( | ) |
Tell the database to prepare the query that we will execute
Definition at line 358 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 530 of file AwlQuery.php.
| AwlQuery::QueryString | ( | ) |
Return the query string we are planning to execute
Definition at line 427 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 318 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 498 of file AwlQuery.php.
| AwlQuery::rownum | ( | ) |
Return the current rownum in the retrieved set
Definition at line 451 of file AwlQuery.php.
| AwlQuery::rows | ( | ) |
Return the count of rows retrieved/affected
Definition at line 443 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 248 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 656 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 510 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 461 of file AwlQuery.php.
|
protected |
Definition at line 144 of file AwlQuery.php.
|
protected |
Definition at line 138 of file AwlQuery.php.
|
protected |
Definition at line 126 of file AwlQuery.php.
|
protected |
Definition at line 174 of file AwlQuery.php.
|
protected |
Definition at line 181 of file AwlQuery.php.
| AwlQuery::$location |
Definition at line 193 of file AwlQuery.php.
| AwlQuery::$location_file |
Definition at line 195 of file AwlQuery.php.
| AwlQuery::$location_line |
Definition at line 194 of file AwlQuery.php.
| AwlQuery::$query_time_warning = 5 |
Definition at line 205 of file AwlQuery.php.
|
protected |
Definition at line 132 of file AwlQuery.php.
|
protected |
Definition at line 156 of file AwlQuery.php.
|
protected |
Definition at line 162 of file AwlQuery.php.
|
protected |
Definition at line 168 of file AwlQuery.php.
|
protected |
Definition at line 150 of file AwlQuery.php.