<?php
	// Read credentials from environment variables
	$db_host = getenv('DB_HOST');
	$db_user = getenv('DB_USER');
	$db_pass = getenv('DB_PASS');
	$db_name = getenv('DB_NAME');

	// Create a new database connection
	$db = new mysqli($db_host, $db_user, $db_pass, $db_name);

	// Check for a connection error
	if($db->connect_error) {die ("<pre>Connection error: $db->connect_error</pre>");}

	// Set charset after successful connection
	$db->set_charset("utf8");
?>
