<?php 
/**
 * Connection to Database
 *
 * @author Mills ABeiku Godfred
 */
class Database{
	// Declare Database Variable Constants
	const DB_HOST = 'localhost';
	const DB_USER = 'zestcons_gamwebtech';
	const DB_PASSWORD = 'Abeiku0555733180@';
	const DB_NAME = 'zestcons_admin';


	public static function connect(){
		$dsn = 'mysql:dbname='.self::DB_NAME.';host='.self::DB_HOST;
		try{
			//Try to Connect to Database
			$conn = new PDO($dsn,self::DB_USER,self::DB_PASSWORD);
		}catch(PDOException $e){
			//Throw an Exception if Connection Fails
			throw new Exception("Database Connection Failed");
		}
		//Return Database connection
		return $conn;
	}
}