Location: PHPKode > projects > HypatiaDB > hypatiadb/common_db.php


//The contents of this file will have to be determined by the system administrator setting up
//HypatiaDB. The variables $host, $username and $password are used every time a php script of
//HypatiaDB needs to connect to the relevant mysql server like so:

/*mysql_connect($host, $username, $password)*/

//Here are the default values.

/*$host = 'localhost';
$username = 'root';
$password = '';*/

$dbfile = dirname(__FILE__) . "/database-password.php";
if(file_exists($dbfile)) {

//Letting every mysql connection with HypatiaDB be through 'root' is obviously not ideal for 
//security, therefore it is recommended that the following changes are made. HypatiaDB uses
//PHP sessions. When a user logs in, their relevant details stored in the 'users' table 
//are placed into session variables (see 'next.php'). 
//Therefore, granted that each HypatiaDB has their own MySQL account (see 'schema.sql'),
//the following replacements should work.

//$host = 'localhost';
//$username = $_SESSION['session_user'];
//$password = $_SESSION['session_user_password'];

//For user authentication purposes, a connection to mysql must be made at the start of 'next.php'. This connection
//must be made with username and password details of the system admin (or someone appropriate), 
//because if using the safer method of assigning $username and $password, '$_SESSION['session_user_status']' 
//and '$_SESSION['session_user_password']' will not be assigned  values until user authentication has been completed.
$admin_username = 'root';
$admin_password = '';

//Choose the default language here
//(Note that individual users will be able to chose their own language once they log in)
//The following languages are currently supported
	* en-au			English (Australian)

$lang = 'en-au';

//OK. You're done here, and can move on to the next step of the installation instructions.

Return current item: HypatiaDB