Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

DBJames Class Reference

List of all members.

Public Member Functions

 DBJames ()
 ConnectDatabase ()
 CloseDatabase ()
 Query ($sql)
 Execute ($sql)
 SetInsertID ()
 GetFieldName ($col)
 getValue ($col)
 Next ()
 First ()
 Go ($pos)
 Debug ()
 OpenFile ()
 CloseFile ()

Public Attributes

 $dbhost
 The host where is the DB.

 $dbuser
 The user of the DB.

 $dbpasswd
 The password of the user of the DB.

 $dbname
 The name of the DB.

 $rs
 RecordSet.

 $row
 Row which contains the current record data.

 $numRows
 Number of rows affected after the query.

 $numFields
 Number of columns returned after the query.

 $dbConnection
 Pointer to the DB connection.

 $sql
 Last SQL query used.

 $newID
 New id automatically generated after an INSERT in the DB.

 $EOF
 Indicates if it is the last record.

 $msgDebug
 Debug message.

 $numErr
 Number of the error.

 $desErr
 Error description.

 $debug = true
 Debug activated.

 $fileLog
 Logs file.

 $fileHdl
 File handler.


Detailed Description

Class that acts as an abstraction layer to the DB access.

This object is specific to the MySql DB but it is possible to change it for other specific to other DB engine very easily

Definition at line 13 of file dbjames.class.php.


Constructor & Destructor Documentation

DBJames::DBJames  ) 
 

Constructor.

It gets the configuration of the DB throw global variables and, then, it makes the connection to the DB.

Definition at line 46 of file dbjames.class.php.

References JSystem::GetConfig().


Member Function Documentation

DBJames::CloseDatabase  ) 
 

It ends a DB connection

Definition at line 84 of file dbjames.class.php.

DBJames::CloseFile  ) 
 

Closes the error log file

Definition at line 264 of file dbjames.class.php.

DBJames::ConnectDatabase  ) 
 

Makes a connection to the DB with the parameters previously specified.

Definition at line 61 of file dbjames.class.php.

DBJames::Debug  ) 
 

Used for the error log...

Definition at line 237 of file dbjames.class.php.

DBJames::Execute sql  ) 
 

Makes a DB query (INSERTs, DELETEs, UPDATEs, ...).

Parameters:
sql The query.
See also:
Query()

Definition at line 135 of file dbjames.class.php.

References $sql.

DBJames::First  ) 
 

Goes to the first row in the recordset

Definition at line 215 of file dbjames.class.php.

DBJames::GetFieldName col  ) 
 

Gets the name of a column using mysql_field_name

Parameters:
col The number of the column.
Returns:
string

Definition at line 173 of file dbjames.class.php.

DBJames::getValue col  ) 
 

Gets the value of the current row for a specific field

Parameters:
col The number or the name of the field.
Returns:
The value of the field.

Definition at line 184 of file dbjames.class.php.

DBJames::Go pos  ) 
 

Goes to the row "pos" in the recordset.

Parameters:
pos The position of the row.

Definition at line 225 of file dbjames.class.php.

DBJames::Next  ) 
 

Goes to the next row in the recordset

Definition at line 197 of file dbjames.class.php.

DBJames::OpenFile  ) 
 

Opens the error log file

Definition at line 254 of file dbjames.class.php.

DBJames::Query sql  ) 
 

Makes a DB query (just SELECTs)

Parameters:
sql The query.
See also:
Execute()

Definition at line 95 of file dbjames.class.php.

References $sql.

DBJames::SetInsertID  ) 
 

Updates the newID after doing a new insertion calling to mysql_insert_id.

Definition at line 160 of file dbjames.class.php.


Member Data Documentation

DBJames::$dbConnection
 

Pointer to the DB connection.

Definition at line 26 of file dbjames.class.php.

DBJames::$dbhost
 

The host where is the DB.

Definition at line 17 of file dbjames.class.php.

DBJames::$dbname
 

The name of the DB.

Definition at line 20 of file dbjames.class.php.

DBJames::$dbpasswd
 

The password of the user of the DB.

Definition at line 19 of file dbjames.class.php.

DBJames::$dbuser
 

The user of the DB.

Definition at line 18 of file dbjames.class.php.

DBJames::$debug = true
 

Debug activated.

Definition at line 34 of file dbjames.class.php.

DBJames::$desErr
 

Error description.

Definition at line 33 of file dbjames.class.php.

DBJames::$EOF
 

Indicates if it is the last record.

Definition at line 29 of file dbjames.class.php.

DBJames::$fileHdl
 

File handler.

Definition at line 36 of file dbjames.class.php.

DBJames::$fileLog
 

Logs file.

Definition at line 35 of file dbjames.class.php.

DBJames::$msgDebug
 

Debug message.

Definition at line 31 of file dbjames.class.php.

DBJames::$newID
 

New id automatically generated after an INSERT in the DB.

Definition at line 28 of file dbjames.class.php.

DBJames::$numErr
 

Number of the error.

Definition at line 32 of file dbjames.class.php.

DBJames::$numFields
 

Number of columns returned after the query.

Definition at line 25 of file dbjames.class.php.

DBJames::$numRows
 

Number of rows affected after the query.

Definition at line 24 of file dbjames.class.php.

DBJames::$row
 

Row which contains the current record data.

Definition at line 23 of file dbjames.class.php.

DBJames::$rs
 

RecordSet.

Definition at line 22 of file dbjames.class.php.

DBJames::$sql
 

Last SQL query used.

Definition at line 27 of file dbjames.class.php.

Referenced by Execute(), and Query().


The documentation for this class was generated from the following file:
Generated on Wed Nov 19 20:29:36 2003 for James by doxygen 1.3.4