<?php 

    // These variables define the connection information for your MySQL database 
    $username = "divinecharitable_hospital"; 
    $password = "DMu17K4_o*z6z"; 
    $host = "localhost"; 
    $dbname = "divinecharitable_hospital"; 
	
    $url = "admin/installer/install.php"; //Link for the installer page folder
	
    $options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'); 
    try { $db = new PDO("mysql:host={$host};dbname={$dbname};charset=utf8", $username, $password, $options); } 
    catch(PDOException $ex){ echo header('Location: '.$url); die;} //redirect to install page if no database connection created
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 
    $db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); 
    header('Content-Type: text/html; charset=utf-8'); 
	
	// 1. Create a database connection
	$conection=mysqli_connect($host,$username,$password,$dbname);
	if (!$conection) {
		die("Database connection failed: " . mysqli_error());
	}

	// 2. Select a database to use 
	$db_selected = mysqli_select_db($conection, $dbname);
	if (!$db_selected) {
		die("Database selection failed: " . mysqli_error());
	}
	
    session_start(); 
?>