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.

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?


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().

SQL::getFieldName (  ) 

Return the field names from the query results.

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

SQL::getQuery (  ) 

Return the query represented by this SQL object.

Returns:
[string]: The query

SQL::mysql_insert_id (  ) 

Return the last inserted primary key.

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


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

Generated on Wed Nov 24 02:03:30 2010 for Common by  doxygen 1.5.6