<?php
try
{
	global $bdd_ninegate;

	%if %%getVar("ninegate_db_mode", 'non') == "externe"
	$dbhost_ninegate = "%%ninegate_dbserver";
	%else if %%getVar("ninegate_db_mode", 'non') == "default"
	%set dbhost = %%getVar('edb_host', 'non')
	%if %%dbhost == 'non' and %%mode_conteneur_actif == 'oui':
	$dbhost_ninegate = "%%adresse_ip_mysql";
	%else
	%if %%dbhost == 'non'
	$dbhost_ninegate = "localhost";
	%else
	$dbhost_ninegate = "%%edb_host";
	%end if
	%end if
	%else
	$dbhost_ninegate = "%%adresse_ip_mysql";
	%end if
	$dbname_ninegate = "ninegate";
	$dbuser_ninegate = "ninegate";
$dbpwd_ninegate  = "changeme";

	$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
	$pdo_options[PDO::MYSQL_ATTR_INIT_COMMAND] = "SET NAMES utf8";

	$bdd_ninegate = new PDO('mysql:host='.$dbhost_ninegate.';dbname='.$dbname_ninegate.'',$dbuser_ninegate,$dbpwd_ninegate, $pdo_options);
}
catch (PDOException $e)
{
	die('Erreur sur BDD ninegate : ' . $e->getMessage());
}