Class dbquery

Description

DB Query class This class is the one which executes queries against the connected database.

Located in /query-defs.php (line 512)

sqlquery
   |
   --dbquery
Direct descendents
Class Description
 class dbrows DB Rows class Renders a query into data and allows access to the data either directly or via the usual get first,last,next,previous cursor navigation.
 class dbdelete DB Delete class A special case of the dbquery class. This is for deleting rows from the database.
Abstract class dbtablemod DB tablemod class Parent class for classes which only modify a single table. This means either update or inserts. This class is provided so we can define a common method for sequence definition.
 class dbseq DB seq class A class which allows the management and use of sequences.
Variable Summary
 mixed $hasdata
 mixed $rid
 mixed $rowcount
 mixed $rowno
 mixed $valid
Method Summary
 dbquery dbquery ([string $sql = ""])
 bool execute ()
 void set_sql (string $sql)
 void tidyup ()
Variables
mixed $affectedrowcount = 0 (line 516)

Number of rows affected by query

mixed $hasdata = false (line 524)

True if data was returned, after execute

mixed $last_errormsg = "" (line 526)

Record last error/info message

mixed $rid = false (line 520)

Current row resource ID

mixed $rowcount = 0 (line 514)

Number of rows returned after execute

mixed $rowno = 0 (line 518)

Current row in the query

mixed $valid = false (line 522)

True if query is valid, post execution

Inherited Variables

Inherited from sqlquery

sqlquery::$fields
sqlquery::$groupby
sqlquery::$limit
sqlquery::$offset
sqlquery::$orderby
sqlquery::$sql
sqlquery::$tables
sqlquery::$type
sqlquery::$where
Methods
Constructor dbquery (line 533)

Constructor Create a new DB Query object.

dbquery dbquery ([string $sql = ""])
  • string $sql: An SQL statement in full
execute (line 545)

Exceute the query If we have an SQL phrase, execute it now. We store the result in this->valid, and also return it. If a transaction is open, update the status.

  • return: True if query was executed successfully
bool execute ()

Redefined in descendants as:
  • dbrows::execute() : Execute query Execute this query. We override the parent method here simply to ensure we are positioned at the first row.
set_sql (line 596)

Set the SQL statement

void set_sql (string $sql)
  • string $sql: An SQL statement in full

Redefined in descendants as:
  • dbrows::set_sql() : Set the SQL statement In this case we re-execute the SQL automatically.
tidyup (line 606)

Free resources.

Not really necessary, but you might be that fastidious kind of person.

void tidyup ()

Inherited Methods

Inherited From sqlquery

 sqlquery::sqlquery()
 sqlquery::build()
 sqlquery::clear()
 sqlquery::fieldlist()
 sqlquery::from()
 sqlquery::groupby()
 sqlquery::into()
 sqlquery::limit()
 sqlquery::offset()
 sqlquery::orderby()
 sqlquery::rebuild()
 sqlquery::set()
 sqlquery::tables()
 sqlquery::where()

Documentation generated by phpDocumentor 1.3.0RC3