diff --git a/includes/db.inc.php b/includes/db.inc.php index 60fb5d5..ca7af22 100644 --- a/includes/db.inc.php +++ b/includes/db.inc.php @@ -11,9 +11,13 @@ $user = getenv('MYSQL_USERNAME'); $pass = getenv('MYSQL_PASSWORD'); +$name= getenv('MYSQL_DB_NAME'); +$host= getenv('MYSQL_DB_HOST'); + + +$data_source = sprintf('mysql:host=%s;dbname=%s', $host, $name ); -$data_source = 'mysql:host=' . getenv('MYSQL_DB_HOST') . ';dbname=' . getenv('MYSQL_DB_NAME').''; //PDO -> php data objects $db = new PDO($data_source, $user, $pass); //Make the connection to speak in UTF 8 - don't expect anything back