<?php 
	
	/*
	* Created by Belal Khan
	* website: www.simplifiedcoding.net 
	*/
	
	//Class DbConnect
	class DbConnect
	{
		//Variable to store database link
		private $con;
	 
		//Class constructor
		function __construct()
		{
	 
		}
	 
		//This method will connect to the database
		function connect()
		{
			//Including the constants.php file to get the database constants
			include_once dirname(__FILE__) . '/Constants.php';
	        $this->conn = mysql_connect(DB_HOST, DB_USER, DB_PASS)  or die ("Could not connect to server ... \n" . mysql_error ());
                mysql_select_db(DB_NAME)  or die ("Could not connect to database ... \n" . mysql_error ());
			//connecting to mysql database
			//$this->con = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
	 
			//Checking if any error occured while connecting
			//if (mysqli_connect_errno()) {
			//	echo "Failed to connect to MySQL: " . mysqli_connect_error();
			//}
//	 realcricket2022 npl
			//finally returning the connection link 
			return $this->conn;
		}
	 
	}