<?php
class DBController {
	private $conn = "";
	private $host = "localhost";
	private $user = "easysof1_ShadiHallUser";
	private $password = "lBdwQVKTH0BM";
	private $database = "easysof1_id12214488_shadihallproject";

	function __construct() {
		$conn = $this->connectDB();
		//echo "asda0";
		if(!empty($conn)) {
			$this->conn = $conn;
			//echo "asda1";
		}
	}

	function connectDB() {
		$conn = mysqli_connect($this->host,$this->user,$this->password,$this->database);
		//echo "asda2";
		return $conn;
	}

	function executeSelectQuery($query) {
	    //echo "asda3";
		$result = mysqli_query($this->conn,$query);
		while($row=mysqli_fetch_assoc($result)) {
		    //echo "asda4";
			$resultset[] = $row;
		}
		if(!empty($resultset))
			return $resultset;
	}
}
?>
