SQL Class Reference

Manages an SQL database query. More...

List of all members.

Public Member Functions

 __construct ($dbO=null, $queryIn="", $queryInfo)
 Construct an SQL query object.
 doSQL ()
 Run the SQL query and cache the results in the DBI.
 getFieldName ()
 Return the field names from the query results.
 getQuery ()
 Return the query represented by this SQL object.
 mysql_insert_id ()
 Return the last inserted primary key.


Detailed Description

Manages an SQL database query.

Definition at line 276 of file DBI.php5.


Constructor & Destructor Documentation

SQL::__construct ( dbO = null,
queryIn = "",
queryInfo 
)

Construct an SQL query object.

Parameters:
$dbO [(mysql) database object]
$queryIn [string]: SQL query
$queryInfo [bool]: Store additional information in the results array?

Definition at line 291 of file DBI.php5.


Member Function Documentation

SQL::doSQL (  ) 

Run the SQL query and cache the results in the DBI.

  • Run the query. Report errors if there is a failure.
  • If we are INSERTING, get the mysql_insert_id so that it can be retrieved from the object by calling mysql_insert_id().
  • If we are SELECTING, make a list of all the fields being returned, which can be retrieved by calling getFieldName().

Definition at line 308 of file DBI.php5.

References SConfig::getOption(), mysql_insert_id(), and SErrorManager::setDebug().

SQL::getFieldName (  ) 

Return the field names from the query results.

Returns:
[array]: The list of field names from the query results

Definition at line 366 of file DBI.php5.

SQL::getQuery (  ) 

Return the query represented by this SQL object.

Returns:
[string]: The query

Definition at line 374 of file DBI.php5.

SQL::mysql_insert_id (  ) 

Return the last inserted primary key.

Returns:
[int]: The mysql_insert_id, the last inserted primary key

Definition at line 386 of file DBI.php5.

Referenced by doSQL().


The documentation for this class was generated from the following file:

Generated on Wed Nov 24 02:06:34 2010 for Common by  doxygen 1.5.6