1.5 Template Project

The Joomla! Documentation Working Group is running a project to develop detailed reference and tutorial material on Joomla! 1.5 templates.  There is a project page on the documentation wiki where you can see the work in progress and help us by contributing your knowledge.

Who's Online

We have 17 guests online

Help Site License

The Joomla! Help Site content is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution NonCommercial ShareAlike 2.5. Some parts of this website may be subject to other licenses.
Home arrow Developer Manual arrow 11. API Reference arrow [REVIEW] database constructor

[REVIEW] database constructor PDF Print E-mail

Last reviewed: Not reviewed
phpDocumentor

database constructor

The constructor for the database class.

Syntax

void database ( [ string $host ] , string $user, string $pass, string $db [, string $prefix
                                              [, string $driver [, string $nullDate ]]] )

$host
is the URL of the system that is hosting the database.  Usually 'localhost'.  This parameter is optional and if omitted will default to 'localhost'.
$user
is the username required to connect to the database.
$pass
is the password associated with $user to be used to connect to the database.
$db
is the name of the database.
$prefix
is the string that will be prefixed to all table names.  From Joomla 1.1 this parameter is optional and if omitted will default to 'mos_'.
$driver
is the database driver name.  This parameter is optional and if omitted will default to an empty string.  This parameter was introduced in Joomla 1.1.
$nullDate
is the string to be used to represent a null date. This parameter is optional and if omitted will default to the null date string defined in the $mosConfig_zero_date entry in the Joomla configuration file.  This parameter was introduced in Joomla 1.1.

Examples

Example:

$host = 'localhost';
$user = 'joomlauser';
$password = 'itsasecret';
$dbase = 'test';
$dbprefix = 'jos_';
$db = new database( $host, $user, $password, $dbase, $dbprefix );

Please report any errors on this page to the Developer Documentation Forum.

Last Updated ( Monday, 25 December 2006 )
 
< Prev   Next >