PgQueryThe PgQuery Class.
This class builds and executes PostgreSQL Queries and traverses the set of results returned from the query.
Example usage
Located in /PgQuery.php (line 254)
string
BuildOptionList
([string $current = ''], [string $location = 'options'], [array $parameters = false])
string
$errorstring
(line 318)
The PostgreSQL error message, if the query fails.
Should be read-only, although any successful Exec should clear it
string
$execution_time
(line 325)
Stores the query execution time - used to deal with long queries.
should be read-only
double
$query_time_warning
= 0.3 (line 334)
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.
int
$rows
(line 311)
number of rows from pg_numrows - for fetching result
should be read-only
Constructor PgQuery (line 344)
Constructor
BuildOptionList (line 583)
Build an option list from the query.
Exec (line 449)
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 493)
Fetch the next row from the query results
FetchBackwards (line 549)
Fetch backwards from the result resource
Plain (line 426)
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!
quote (line 414)
Quote the given string so it can be safely used within string delimiters in a query.
SetConnection (line 371)
Use a different database connection for this query
UnFetch (line 538)
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
_log_error (line 389)
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(...);
Documentation generated on Tue, 18 Nov 2008 18:08:59 +1300 by phpDocumentor 1.3.2