====== __construct ====== {#JAPI Joomla.Framework Database JDatabase::__construct #} The constructor for the database class. The construct is responsible for opening a connection to the database and setting any necessary settings. ===== Syntax ===== JDatabase __construct ( **$host**, **$user**, **$pass**, **$db**, **$table_prefix** ) | **$host** | string | 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** | string | is the username required to connect to the database. | | **$pass** | string | is the password associated with $user to be used to connect to the database. | | **$db** | string | is the name of the database. | | **$table_prefix** | string | is the string that will be prefixed to all table names. From Joomla! 1.5 this parameter is optional and if omitted will default to 'jos_'. | ===== Examples ===== $host = 'localhost'; $user = 'joomlauser'; $password = 'itsasecret'; $dbase = 'test'; $dbprefix = 'jos_'; $db = new JDatabase( $host, $user, $password, $dbase, $dbprefix ); ---- ~~DISCUSSION~~