Andrew's Web Libraries (AWL)
|
Public Member Functions | |
__construct () | |
SetConnection ( $new_connection) | |
_log_error ( $locn, $tag, $string, $line=0, $file="") | |
rows () | |
quote ($str=null) | |
Plain ( $field) | |
Exec ( $location='', $line=0, $file='') | |
Fetch ($as_array=false) | |
UnFetch () | |
FetchBackwards ($as_array=false) | |
BuildOptionList ( $current='', $location='options', $parameters=false) | |
Public Attributes | |
$connection | |
$querystring | |
$result | |
$rownum = -1 | |
$location | |
$object | |
$rows | |
$errorstring | |
$execution_time | |
$query_time_warning = 0.3 | |
Definition at line 277 of file PgQuery.php.
PgQuery::__construct | ( | ) |
#- Constructor
string | The query string with replacable '?' characters. |
mixed | The values to replace into the SQL string. |
Definition at line 367 of file PgQuery.php.
PgQuery::_log_error | ( | $locn, | |
$tag, | |||
$string, | |||
$line = 0 , |
|||
$file = "" |
|||
) |
Log error, optionally with file and line location of the caller.
This function should not really be used outside of PgQuery. 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 412 of file PgQuery.php.
PgQuery::BuildOptionList | ( | $current = '' , |
|
$location = 'options' , |
|||
$parameters = false |
|||
) |
Build an option list from the query.
string | $current | Default selection of drop down box (optional) |
string | $location | for debugging purposes |
array | $parameters | an array further parameters, including 'maxwidth' => 20 to set a maximum width |
Definition at line 615 of file PgQuery.php.
PgQuery::Exec | ( | $location = '' , |
|
$line = 0 , |
|||
$file = '' |
|||
) |
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 478 of file PgQuery.php.
PgQuery::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 525 of file PgQuery.php.
PgQuery::FetchBackwards | ( | $as_array = false | ) |
Fetch backwards from the result resource
boolean | $as_array | True if thing to be returned is array (default: False |
Definition at line 581 of file PgQuery.php.
PgQuery::Plain | ( | $field | ) |
Convert a string which has already been quoted and escaped for PostgreSQL into a magic array so that it will be inserted unmodified into the SQL string. Use with care!
string | $field | The value which has alread been quoted and escaped. |
Definition at line 455 of file PgQuery.php.
PgQuery::quote | ( | $str = null | ) |
Quote the given string so it can be safely used within string delimiters in a query.
mixed | $str | Data to be converted to a string suitable for including as a value in SQL. |
Definition at line 443 of file PgQuery.php.
PgQuery::rows | ( | ) |
Provide a rows() method for forward compatibility with AwlQuery.
Definition at line 429 of file PgQuery.php.
PgQuery::SetConnection | ( | $new_connection | ) |
Use a different database connection for this query
resource | $new_connection | The database connection to use. |
Definition at line 394 of file PgQuery.php.
PgQuery::UnFetch | ( | ) |
Set row counter back one
In the case that you may like to fetch the same row twice, for example if your SQL returns some columns that are the same for each row, and you want to display them cleanly before displaying the other data repeatedly for each row.
Example $master_row = $qry->Fetch(); $qry->UnFetch(); do_something_first($master_row); while( $row = $qry->Fetch() ) { do_something_repeatedly($row); }
Definition at line 570 of file PgQuery.php.
PgQuery::$connection |
Definition at line 287 of file PgQuery.php.
PgQuery::$errorstring |
Definition at line 341 of file PgQuery.php.
PgQuery::$execution_time |
Definition at line 348 of file PgQuery.php.
PgQuery::$location |
Definition at line 315 of file PgQuery.php.
PgQuery::$object |
Definition at line 322 of file PgQuery.php.
PgQuery::$query_time_warning = 0.3 |
Definition at line 357 of file PgQuery.php.
PgQuery::$querystring |
Definition at line 294 of file PgQuery.php.
PgQuery::$result |
Definition at line 301 of file PgQuery.php.
PgQuery::$rownum = -1 |
Definition at line 308 of file PgQuery.php.
PgQuery::$rows |
Definition at line 334 of file PgQuery.php.