/** * Gets an instance of the database object (singleton) and connects to the database * @return MySQLDatabase $databasewrapper */ public static function getInstance($host, $user, $pass, $dbname) { if (!self::$me) { mysql_connect($host, $user, $pass); mysql_selectdb($dbname); self::$me = new MySQLDatabase(); } return self::$me; }