EmbientDatabase Class Reference

List of all members.

Detailed Description

Provide a mySQL 4.x database interface to the system.

Definition at line 17 of file embient.db.php.

Public Member Functions

 EmbientDatabase ()
 Constructor - to initialise all variables.
 Init ($cfg)
 Initialise the database.
 Connect ()
 Connect to database.
 Disconnect ()
 Disconnect from database.
 Query ($query, $file, $line)
 Execute the database query.
 GetRowsCount ()
 return the number of rows from previous query
 FetchArray ()
 return a single row of an associative array of column_name => value of previous query.
 FetchAll ()
 return all result from the previous query in an associative array.
 FetchRow ()
 return a single row of the result in a linear array.
 GetNextID ($tablename, $idname)
 get next unique ID from database

Public Attributes

 $connection
 database connection
 $result
 last result id to use with mySQL function

Private Member Functions

 _prepare ($sql)

Private Attributes

 $_db_host
 $_db_user
 $_db_pass
 $_db_name
 $_prefix


Constructor & Destructor Documentation

EmbientDatabase::EmbientDatabase  ) 
 

Constructor - to initialise all variables.

Definition at line 47 of file embient.db.php.


Member Function Documentation

EmbientDatabase::_prepare sql  )  [private]
 

prepare the query

Parameters:
$sql string - query string
Returns:
string of formatted query

Definition at line 299 of file embient.db.php.

EmbientDatabase::Connect  ) 
 

Connect to database.

Returns:
database link id on success, false on fail

Definition at line 94 of file embient.db.php.

Here is the call graph for this function:

EmbientDatabase::Disconnect  ) 
 

Disconnect from database.

Definition at line 130 of file embient.db.php.

Here is the call graph for this function:

EmbientDatabase::FetchAll  ) 
 

return all result from the previous query in an associative array.

Returns:
associative array of all result from the previous query in the format of (column_name => value)

Definition at line 214 of file embient.db.php.

Here is the call graph for this function:

EmbientDatabase::FetchArray  ) 
 

return a single row of an associative array of column_name => value of previous query.

Returns:
associative array of previous query in the format of (column_name => value)

Definition at line 197 of file embient.db.php.

Here is the call graph for this function:

EmbientDatabase::FetchRow  ) 
 

return a single row of the result in a linear array.

Returns:
array of result from previous query, depends on the column selected by query

Definition at line 239 of file embient.db.php.

Here is the call graph for this function:

EmbientDatabase::GetNextID tablename,
idname
 

get next unique ID from database

Return a new unique ID in the given sequence according to value in {sequence} table. Currently, this function support only Drupal style.

Parameters:
$tablename string - name of table (with {} markup) where the unique ID is kept.
$idname string - name of id (with {} markup) to be returned.
Returns:
next ID from the table

Definition at line 265 of file embient.db.php.

Here is the call graph for this function:

EmbientDatabase::GetRowsCount  ) 
 

return the number of rows from previous query

Returns:
number of data rows from previous query

Definition at line 180 of file embient.db.php.

Here is the call graph for this function:

EmbientDatabase::Init cfg  ) 
 

Initialise the database.

Parameters:
$cfg associative array of database engine
Returns:
true - if success, false - if failed

Definition at line 68 of file embient.db.php.

Here is the call graph for this function:

EmbientDatabase::Query query,
file,
line
 

Execute the database query.

Parameters:
$query string - query string with {} table prefix markup
$file string - file name of the caller
$line string - line number where call this function
Returns:
true - success, false - fail

Definition at line 161 of file embient.db.php.

Here is the call graph for this function:


Member Data Documentation

EmbientDatabase::$_db_host [private]
 

database host name

Definition at line 28 of file embient.db.php.

EmbientDatabase::$_db_name [private]
 

name of database to connect to

Definition at line 37 of file embient.db.php.

EmbientDatabase::$_db_pass [private]
 

password to login to database server

Definition at line 34 of file embient.db.php.

EmbientDatabase::$_db_user [private]
 

user name to login to database server

Definition at line 31 of file embient.db.php.

EmbientDatabase::$_prefix [private]
 

table prefix to put in front of all table name

Definition at line 40 of file embient.db.php.

EmbientDatabase::$connection
 

database connection

Definition at line 20 of file embient.db.php.

EmbientDatabase::$result
 

last result id to use with mySQL function

Definition at line 23 of file embient.db.php.


The documentation for this class was generated from the following file:
Generated on Fri Feb 10 15:05:56 2006 for Embient by  doxygen 1.4.6-NO