Phpfox_Database

Description

Database layer for phpFox. All interactions with a database is done via this class.

It connects to a specific driver such as MySQL or MySQLi or Oracle based on the site owners needs.

Example use of an SQL query:

  1.  Phpfox::getLib('database')->query('SELECT * FROM user');

Example use to get multiple rows from a table:

  1.  $aRows Phpfox::getLib('database')->select('*')
  2.          ->from('user')
  3.          ->where('user_name = \'foo\'')
  4.          ->execute('getRows');

Example to insert data into the database:

  1.  Phpfox::getLib('database')->insert('user'array(
  2.              'email' => 'foo@bar.com',
  3.              'full_name' => 'Full Name'
  4.          )
  5.     );

Example to update a record:

  1.  Phpfox::getLib('database')->update('user'array('email' => 'foo@bar.com')'user_id = 1');

Example to delete a record:

  1.  Phpfox::getLib('database')->delete('user''user_id = 1');

  • author: Raymond Benc
  • version: $Id: database.class.php 1687 2010-07-22 03:13:27Z Raymond_Benc $
  • copyright: [PHPFOX_COPYRIGHT]

Located in /include/library/phpfox/database/database.class.php (line 52)


	
			
Variable Summary
 object $_oObject
Method Summary
 Phpfox_Database __construct ()
 object Object &getInstance ()
Variables
object $_oObject = null (line 59)

Holds the drivers object

  • access: private
Methods
Constructor __construct (line 65)

Loads and initiates the SQL driver that we need to use.

  • access: public
Phpfox_Database __construct ()
getInstance (line 101)

Return the object of the storage object.

  • return: provided by the storage class we loaded earlier.
  • access: public
object Object &getInstance ()

Documentation generated on Tue, 28 Sep 2010 10:36:38 +0200 by phpDocumentor 1.4.0a2