<?php

$hostname = "localhost";
$username = "root";
$password = "";
$dbname = "icreports";

$conn = mysqli_connect($hostname,$username,$password,$dbname);
if(!$conn):
	die('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());
endif;


try {
	$pdo = new PDO("mysql:host=$hostname;dbname=$dbname", $username, $password, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
	$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

}catch(PDOException $e){
	echo "Connection failed: " . $e->getMessage();
	die();
}

?>